From 2a0daae155f9bcd28887d8a2dbc6beeff62fe5ba Mon Sep 17 00:00:00 2001 From: Alexander Bakker Date: Wed, 10 Apr 2019 11:42:35 +0200 Subject: [PATCH] Fix crash that occurred when scheme of the URI in a QR code is missing --- .../java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java b/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java index aed08ccf..01536c66 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java +++ b/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java @@ -57,7 +57,8 @@ public class GoogleAuthInfo { } public static GoogleAuthInfo parseUri(Uri uri) throws GoogleAuthInfoException { - if (!uri.getScheme().equals("otpauth")) { + String scheme = uri.getScheme(); + if (scheme == null || scheme.equals("otpauth")) { throw new GoogleAuthInfoException("unsupported protocol"); }