mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-24 00:37:10 -04:00
[app] don't crash on invalid repo URLs
Fixes acra-crash-reports#218
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
00b68f0442
commit
8d61de333b
@@ -232,10 +232,18 @@ public class ManageReposActivity extends AppCompatActivity implements RepoAdapte
|
||||
try {
|
||||
new URL(text);
|
||||
Uri uri = Uri.parse(text);
|
||||
fingerprint = uri.getQueryParameter("fingerprint");
|
||||
try {
|
||||
fingerprint = uri.getQueryParameter("fingerprint");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
Log.e(TAG, "Error getting fingerprint ", e);
|
||||
}
|
||||
// uri might contain a QR-style, all uppercase URL:
|
||||
if (TextUtils.isEmpty(fingerprint)) {
|
||||
fingerprint = uri.getQueryParameter("FINGERPRINT");
|
||||
try {
|
||||
fingerprint = uri.getQueryParameter("FINGERPRINT");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
Log.e(TAG, "Error getting fingerprint ", e);
|
||||
}
|
||||
}
|
||||
|
||||
String userInfo = uri.getUserInfo();
|
||||
|
||||
Reference in New Issue
Block a user