Nabia fix: added guard against null