Added null ref check.
#MBL-10207 Fixed