fix crash when no FingerprintManager is available, fixes #474
This commit is contained in:
		| @@ -34,7 +34,7 @@ namespace keepass2android | ||||
|  | ||||
| 		public FingerprintManager FingerprintManager  | ||||
| 		{ | ||||
| 			get { return (FingerprintManager) Context.GetSystemService(Context.FingerprintService); } | ||||
| 			get { return Context.GetSystemService(Context.FingerprintService) as FingerprintManager; } | ||||
| 		} | ||||
|  | ||||
| 		public KeyguardManager KeyguardManager  | ||||
|   | ||||
| @@ -223,7 +223,7 @@ namespace keepass2android | ||||
| 			if (requestCode == FingerprintPermissionRequestCode && grantResults[0] == Permission.Granted)  | ||||
| 			{ | ||||
| 				FingerprintModule fpModule = new FingerprintModule(this); | ||||
| 				if (!fpModule.FingerprintManager.IsHardwareDetected) | ||||
| 				if (fpModule.FingerprintManager == null || (!fpModule.FingerprintManager.IsHardwareDetected)) | ||||
| 				{ | ||||
| 					//seems like not all Samsung Devices (e.g. Note 4) don't support the Android 6 fingerprint API | ||||
| 					if (!TrySetupSamsung()) | ||||
|   | ||||
| @@ -633,7 +633,7 @@ namespace keepass2android | ||||
|             { | ||||
|  | ||||
|                 FingerprintModule fpModule = new FingerprintModule(this); | ||||
|                 if (fpModule.FingerprintManager.IsHardwareDetected) | ||||
|                 if (fpModule.FingerprintManager != null && fpModule.FingerprintManager.IsHardwareDetected) | ||||
|                 { | ||||
|                     FingerprintUnlockMode um; | ||||
|                     Enum.TryParse(_prefs.GetString(Database.GetFingerprintModePrefKey(App.Kp2a.GetDb().Ioc), ""), out um); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Philipp Crocoll
					Philipp Crocoll