From b9f19970dfce71361013a5da3fe6907f601a658b Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sat, 30 Dec 2017 23:06:53 +0100 Subject: [PATCH] Small safety measure against null device --- .../gadgetbridge/activities/appmanager/AppManagerActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AppManagerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AppManagerActivity.java index 00c9a8e1f..80dd7678d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AppManagerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AppManagerActivity.java @@ -69,7 +69,8 @@ public class AppManagerActivity extends AbstractGBFragmentActivity { Bundle extras = getIntent().getExtras(); if (extras != null) { mGBDevice = extras.getParcelable(GBDevice.EXTRA_DEVICE); - } else { + } + if (mGBDevice == null) { throw new IllegalArgumentException("Must provide a device when invoking this activity"); }