diff --git a/app/src/main/java/com/jens/automation2/receivers/BroadcastListener.java b/app/src/main/java/com/jens/automation2/receivers/BroadcastListener.java index 204a3b5..b994a3e 100644 --- a/app/src/main/java/com/jens/automation2/receivers/BroadcastListener.java +++ b/app/src/main/java/com/jens/automation2/receivers/BroadcastListener.java @@ -52,9 +52,13 @@ public class BroadcastListener extends android.content.BroadcastReceiver impleme { broadcastsCollection.add(new EventOccurrence(Calendar.getInstance(), intent.getAction())); - for(String key : intent.getExtras().keySet()) + Miscellaneous.logEvent("i", "Broadcast received", "Broadcast " + intent.getAction() + " received.", 4); + if(intent.getExtras() != null && intent.getExtras().size() > 0) { - Miscellaneous.logEvent("i", "Broadcast extra", "Broadcast " + intent.getAction() + " has extra " + key + " and type " + intent.getExtras().get(key).getClass().getName(), 4); + for (String key : intent.getExtras().keySet()) + { + Miscellaneous.logEvent("i", "Broadcast extra", "Broadcast " + intent.getAction() + " has extra " + key + " and type " + intent.getExtras().get(key).getClass().getName(), 4); + } } ArrayList ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.broadcastReceived); diff --git a/fastlane/metadata/android/en-US/changelogs/138.txt b/fastlane/metadata/android/en-US/changelogs/138.txt index 5bed413..ae7eecd 100644 --- a/fastlane/metadata/android/en-US/changelogs/138.txt +++ b/fastlane/metadata/android/en-US/changelogs/138.txt @@ -1 +1,2 @@ -* Fixed: Overlay permission for start other program action only required if startByActivity() is selected \ No newline at end of file +* Fixed: Overlay permission for start other program action only required if startByActivity() is selected +* Fixed: Broadcast receiver trigger would not trigger anything, but crash \ No newline at end of file