Skip to content

Commit

Permalink
potencial NPE fix willowtreeapps#231
Browse files Browse the repository at this point in the history
  • Loading branch information
v-mas committed Nov 8, 2023
1 parent f81c48e commit f93ab77
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@ final class OpenMenuReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
final Activity activity = HyperionService.this.activity.get();
if (activity != null) {
AppComponent.Holder.getInstance(HyperionService.this)
.getPublicControl().open(activity);
WeakReference<Activity> ref = HyperionService.this.activity;
if (ref != null) {
final Activity activity = ref.get();
if (activity != null) {
AppComponent.Holder.getInstance(HyperionService.this)
.getPublicControl().open(activity);
}
}
}
}
Expand Down

0 comments on commit f93ab77

Please sign in to comment.