[#519] Inverting check avoids NPE