[BUGFIX] Prevent PHP warning when trying to loop over null