diff options
| author | Fabian Henneke <FabianHenneke@users.noreply.github.com> | 2020-04-16 12:20:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-16 12:20:45 +0200 |
| commit | e4aa673537f198034755ed1113754fbbe05b0138 (patch) | |
| tree | b2f6ca4f45dc02259b0a39cfab9ffdf2f61adc74 /app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt | |
| parent | 2a6326ec0ea04ceade7e56749b4cd09f810a34a7 (diff) | |
| download | HardenedPass-e4aa673537f198034755ed1113754fbbe05b0138.tar.gz HardenedPass-e4aa673537f198034755ed1113754fbbe05b0138.zip | |
Reduce build warnings (#712)
* Add annotations to and reformat SearchableRepositoryViewModel.kt
* Address build warnings other than meaningful deprecations
* Deal with warnings in UserPreference.kt
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt index 934c5395..c3186db5 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt @@ -47,20 +47,23 @@ class AutofillActivity : AppCompatActivity() { finish() // go back to the password field app when (requestCode) { REQUEST_CODE_DECRYPT_AND_VERIFY -> if (resultCode == RESULT_OK) { - AutofillService.instance?.setResultData(data!!) // report the result to service + require(data != null) + AutofillService.instance?.setResultData(data) // report the result to service } REQUEST_CODE_PICK -> if (resultCode == RESULT_OK) { - AutofillService.instance?.setPickedPassword(data!!.getStringExtra("path")) + require(data != null) + AutofillService.instance?.setPickedPassword(data.getStringExtra("path")!!) } REQUEST_CODE_PICK_MATCH_WITH -> if (resultCode == RESULT_OK) { + require(data != null) // need to not only decrypt the picked password, but also // update the "match with" preference val extras = intent.extras ?: return val packageName = extras.getString("packageName") val isWeb = extras.getBoolean("isWeb") - val path = data!!.getStringExtra("path") - AutofillService.instance?.setPickedPassword(data.getStringExtra("path")) + val path = data.getStringExtra("path") + AutofillService.instance?.setPickedPassword(data.getStringExtra("path")!!) val prefs: SharedPreferences prefs = if (!isWeb) { |
