indraneel  | #1420 | added  null checks and testcases