Skip to content

Commit

Permalink
Fix NPE in ImageAssetManager#hasSameContext (airbnb#2503)
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Wu committed Aug 6, 2024
1 parent 5a71516 commit 803e39f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public void setDelegate(@Nullable ImageAssetDelegate assetDelegate) {
}

public boolean hasSameContext(Context context) {
if (context == null) {
return this.context == null;
}
Context contextToCompare = this.context instanceof Application ? context.getApplicationContext() : context;
return contextToCompare == this.context;
}
Expand Down

0 comments on commit 803e39f

Please sign in to comment.