Skip to content

Commit

Permalink
Fix: Updated Broadcast receiver to do nothing if key is null (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel authored Dec 18, 2023
1 parent d759f09 commit 6508067
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ public void onReceive(Context context, Intent intent) {
) {
return;
}
// If key is null, do nothing
if (key == null) {
return;
}
switch (key) {
case TestAsyncTask.RUN:
Log.d(TAG, "TestAsyncTask.RUN");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public TestRunBroadRequestReceiver(PreferenceManager preferenceManager, EventLis
public void onReceive(Context context, Intent intent) {
String key = intent.getStringExtra("key");
String value = intent.getStringExtra("value");
// If key is null, do nothing
if (key == null) {
return;
}
switch (key) {
case TestAsyncTask.START:
listener.onStart(service);
Expand Down

0 comments on commit 6508067

Please sign in to comment.