boolean (PsiStatement statement, @NotNull PsiVariable variable) { if (!(statement instanceof PsiIfStatement ifStatement)) { return false; } final PsiStatement elseBranch = ifStatement.getElseBranch(); if (elseBranch != null) { return false; } final PsiStatement thenBranch = ifStatement.getThenBranch(); if (!isSimpleThrowStatement(thenBranch)) { return false; } final PsiExpression condition = ifStatement.getCondition(); return ComparisonUtils.isNullComparison(condition, variable, true); }