Skip to content

Commit

Permalink
Fix missing null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JuditKnoll committed Oct 13, 2023
1 parent 4b46444 commit 768099b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ public void visitClassContext(ClassContext classContext) {
*/
private boolean isInitialArg() {
XMethod m = getXMethodOperand();
int numPar = m.getNumParams();
// Get values from the stack
for (int i = 0; i < numPar; i++) {
Item item = stack.getStackItem(i);
if (item.isInitialParameter())
return true;
if (m != null) {
int numPar = m.getNumParams();
// Get values from the stack
for (int i = 0; i < numPar; i++) {
Item item = stack.getStackItem(i);
if (item.isInitialParameter())
return true;
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private boolean checkSeen(int seen) {
*/
@Override
protected void detect(int seen) {
if (isMethodCall(seen)) {
if (isMethodCall(seen) && getXClassOperand() != null && getXMethodOperand() != null) {
String retSig = new SignatureParser(getXMethodOperand().getSignature()).getReturnTypeSignature();
String classSig = getXClassOperand().getSourceSignature();
if (MutableClasses.mutableSignature("L" + getClassConstantOperand() + ";") &&
Expand Down

0 comments on commit 768099b

Please sign in to comment.