Skip to content

Commit a1d83cc

Browse files
committed
fixed an NPE
1 parent 7bcfb22 commit a1d83cc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

soot-infoflow-android/src/soot/jimple/infoflow/android/callbacks/filters/AlienHostComponentFilter.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public class AlienHostComponentFilter extends AbstractCallbackFilter {
3030
/**
3131
* Creates a new instance of the {@link AlienHostComponentFilter} class
3232
*
33-
* @param components
34-
* The set of components in the Android app
33+
* @param components The set of components in the Android app
3534
*/
3635
public AlienHostComponentFilter(Set<SootClass> components) {
3736
this.components = components;
@@ -49,9 +48,12 @@ public boolean accepts(SootClass component, SootClass callbackHandler) {
4948

5049
// If the callback class is a fragment, but the hosting component is not
5150
// an activity, this association must be wrong.
52-
if (Scene.v().getOrMakeFastHierarchy().canStoreType(callbackHandler.getType(), this.fragmentClass.getType()))
53-
if (!Scene.v().getOrMakeFastHierarchy().canStoreType(component.getType(), this.activityClass.getType()))
54-
return false;
51+
if (fragmentClass != null && activityClass != null) {
52+
if (Scene.v().getOrMakeFastHierarchy().canStoreType(callbackHandler.getType(),
53+
this.fragmentClass.getType()))
54+
if (!Scene.v().getOrMakeFastHierarchy().canStoreType(component.getType(), this.activityClass.getType()))
55+
return false;
56+
}
5557

5658
// If the callback handler is an inner class, we only accept it if its
5759
// outer class matches the component

0 commit comments

Comments
 (0)