BS-2969
Fix npe and NLS