Skip to content

Commit

Permalink
fix crash in RedundantConstructorCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Jun 19, 2024
1 parent 180104c commit 417add1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public void process(CtClass<?> element) {
.toArray(CtTypeReference<?>[]::new);
var canonicalCtor = record.getConstructor(types);

if (!canonicalCtor.isImplicit()
if (canonicalCtor != null
&& !canonicalCtor.isImplicit()
&& hasEffectivelyDefaultVisibility(record, canonicalCtor)
&& isDefaultBodyRecord(record, canonicalCtor)) {
redundantCtor = canonicalCtor;
Expand Down

0 comments on commit 417add1

Please sign in to comment.