BUG-1144 : added defensive statements to avoid NPEs.

Change-Id: Ifd8e91f619c9165492458ffb07252699d15185fa
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>