Skip to content

Commit

Permalink
Fixed NullPointerException when calling ComposeVariable.startsWithVar…
Browse files Browse the repository at this point in the history
…iable()
  • Loading branch information
tsantalis committed Apr 5, 2016
1 parent 994016b commit 91ec1ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gr/uom/java/ast/decomposition/cfg/MethodCallAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void processArgumentsOfInternalMethodInvocation(ClassObject classObject,
}
else if(usedField instanceof CompositeVariable) {
CompositeVariable composite = (CompositeVariable)usedField;
if(composite.startsWithVariable(variable)) {
if(variable != null && composite.startsWithVariable(variable)) {
//getRightPart() is not correct if variable is a CompositeVariable
cache.addUsedFieldForMethodExpression(composite.getRightPartAfterPrefix(variable), methodObject);
usedFieldCount++;
Expand All @@ -134,7 +134,7 @@ else if(usedField instanceof CompositeVariable) {
}
else if(definedField instanceof CompositeVariable) {
CompositeVariable composite = (CompositeVariable)definedField;
if(composite.startsWithVariable(variable)) {
if(variable != null && composite.startsWithVariable(variable)) {
//getRightPart() is not correct if variable is a CompositeVariable
cache.addDefinedFieldForMethodExpression(composite.getRightPartAfterPrefix(variable), methodObject);
definedFieldCount++;
Expand Down

0 comments on commit 91ec1ac

Please sign in to comment.