Skip to content

Commit

Permalink
Fixed NiklasMerz#158: Resources thrown when the application is killed…
Browse files Browse the repository at this point in the history
… by OS
  • Loading branch information
rpanadero committed Apr 8, 2019
1 parent f296765 commit 6b4fd9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/android/Fingerprint.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
6 changes: 6 additions & 0 deletions src/android/FingerprintAuthenticationDialogFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b4fd9f

Please sign in to comment.