From 8a0e4caafff152d2be31a315e9e157a8a92b6cd0 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Mon, 18 Jan 2016 02:37:22 -0800 Subject: [PATCH] Fixed crash --- .../kde/kdeconnect/UserInterface/SettingsActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java b/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java index f0315793..09bd6872 100644 --- a/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java +++ b/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java @@ -50,6 +50,15 @@ public class SettingsActivity extends AppCompatPreferenceActivity { @Override public void onServiceStart(BackgroundService service) { final Device device = service.getDevice(deviceId); + if (device == null) { + SettingsActivity.this.runOnUiThread(new Runnable() { + @Override + public void run() { + SettingsActivity.this.finish(); + } + }); + return; + } Set plugins = PluginFactory.getAvailablePlugins(); for (final String pluginKey : plugins) { PluginPreference pref = new PluginPreference(SettingsActivity.this, pluginKey, device);