Fix for : storing user if user is blocked and no user groups is attached with object.

$user->block == 1
and $user->groups == array()

Then at line number 346, $query variable is used without being initialized. It was initialized at line number 321, which will not be executed in my case.