2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-01 14:45:08 +00:00

Add null check before using RemoteKeyboardService.instance.visible

This commit is contained in:
Sohny Bohny
2020-07-31 15:37:00 +00:00
committed by Nicolas Fella
parent 7ad78d95c4
commit fd29755cf1

View File

@@ -131,7 +131,8 @@ public class RemoteKeyboardPlugin extends Plugin implements SharedPreferences.On
PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this);
final boolean editingOnly = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.remotekeyboard_editing_only), true); final boolean editingOnly = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.remotekeyboard_editing_only), true);
notifyKeyboardState(editingOnly ? RemoteKeyboardService.instance.visible : true); if (RemoteKeyboardService.instance != null)
notifyKeyboardState(editingOnly ? RemoteKeyboardService.instance.visible : true);
return true; return true;
} }