Check for NPE if the result set is null