diff --git a/src/android/Fingerprint.java b/src/android/Fingerprint.java index 32fd67c0..a6b69c6a 100644 --- a/src/android/Fingerprint.java +++ b/src/android/Fingerprint.java @@ -433,4 +433,8 @@ public static boolean setPluginResultError(String errorMessage) { mPluginResult = new PluginResult(PluginResult.Status.ERROR); return false; } + + public static boolean isPluginSetUp() { + return Fingerprint.packageName != null; + } } \ No newline at end of file diff --git a/src/android/FingerprintAuthenticationDialogFragment.java b/src/android/FingerprintAuthenticationDialogFragment.java index 54fb28d4..b153f2b4 100644 --- a/src/android/FingerprintAuthenticationDialogFragment.java +++ b/src/android/FingerprintAuthenticationDialogFragment.java @@ -78,6 +78,12 @@ public void onCreate(Bundle savedInstanceState) { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + if (!Fingerprint.isPluginSetUp()) { + Log.i(TAG, "Invalid state, view not created"); + dismissAllowingStateLoss(); + return null; + } + Bundle args = getArguments(); disableBackup = args.getBoolean("disableBackup"); Log.d(TAG, "disableBackup: " + disableBackup);