Skip to content

Commit

Permalink
Prevent NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMil committed Apr 17, 2024
1 parent cc91b77 commit c89a628
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/main/java/soot/AbstractASMBackend.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,12 @@ protected void generateMethods() {
if (va == null) {
continue;
}
for (AnnotationTag at : va.getAnnotations()) {
AnnotationVisitor av = mv.visitParameterAnnotation(j, at.getType(),
(va.getVisibility() == AnnotationConstants.RUNTIME_VISIBLE));
generateAnnotationElems(av, at.getElems(), true);
if (va.hasAnnotations()) {
for (AnnotationTag at : va.getAnnotations()) {
AnnotationVisitor av = mv.visitParameterAnnotation(j, at.getType(),
(va.getVisibility() == AnnotationConstants.RUNTIME_VISIBLE));
generateAnnotationElems(av, at.getElems(), true);
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/soot/tagkit/VisibilityAnnotationTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

import java.util.ArrayList;
import java.util.List;

/**
* Represents the visibility of an annotation attribute attached to a class, field, method or method param (only one of these
Expand Down Expand Up @@ -94,7 +95,7 @@ public void addAnnotation(AnnotationTag a) {
annotations.add(a);
}

public ArrayList<AnnotationTag> getAnnotations() {
public List<AnnotationTag> getAnnotations() {
return annotations;
}

Expand Down

0 comments on commit c89a628

Please sign in to comment.