Fixed #5866 (False negative: useless condition or null pointer dereference (null object after while loop, method))