Fixed crash when a namespace was not found (NULL ptr)

Change-Id: Id1d390d7e260eec08e7a4767acedffd47b4ae161