Skip to content

Commit

Permalink
Merge pull request #2 from Chuckytuh/patch-1
Browse files Browse the repository at this point in the history
Prevents NPE after second checkDevice() call
  • Loading branch information
agmv authored Apr 10, 2018
2 parents 223c1b5 + 6dfab77 commit 71eacc6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/android/secureDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ private void checkDevice() {
if (_isDeviceRooted || !_isPasscodeSet) {
// Remove View
View v = this.view.getView();
ViewGroup viewParent = (ViewGroup) v.getParent();
viewParent.removeView(v);

if (v != null) {
ViewGroup viewParent = (ViewGroup) v.getParent();
if (viewParent != null) {
viewParent.removeView(v);
}
}
// Show message and quit
Application app = cordova.getActivity().getApplication();
String package_name = app.getPackageName();
Expand Down

0 comments on commit 71eacc6

Please sign in to comment.