Fixing possible null dereference.