fix for NPE in if/elseif condition if result is null