Commit 3d40b08a authored by justin's avatar justin

空指针保护

parent fb8519f8
...@@ -400,7 +400,7 @@ public class XFlutterView extends FrameLayout { ...@@ -400,7 +400,7 @@ public class XFlutterView extends FrameLayout {
*/ */
@Override @Override
public boolean checkInputConnectionProxy(View view) { public boolean checkInputConnectionProxy(View view) {
return flutterEngine != null return flutterEngine != null&&view!=null
? flutterEngine.getPlatformViewsController().checkInputConnectionProxy(view) ? flutterEngine.getPlatformViewsController().checkInputConnectionProxy(view)
: super.checkInputConnectionProxy(view); : super.checkInputConnectionProxy(view);
} }
......
...@@ -357,6 +357,8 @@ public class XTextInputPlugin { ...@@ -357,6 +357,8 @@ public class XTextInputPlugin {
String keyboardName = Settings.Secure.getString(mView.getContext().getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); String keyboardName = Settings.Secure.getString(mView.getContext().getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
// The Samsung keyboard is called "com.sec.android.inputmethod/.SamsungKeypad" but look // The Samsung keyboard is called "com.sec.android.inputmethod/.SamsungKeypad" but look
// for "Samsung" just in case Samsung changes the name of the keyboard. // for "Samsung" just in case Samsung changes the name of the keyboard.
if(keyboardName==null) return false;
return keyboardName.contains("Samsung"); return keyboardName.contains("Samsung");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment