Fix crash that occurred when scheme of the URI in a QR code is missing

This commit is contained in:
Alexander Bakker 2019-04-10 11:42:35 +02:00
parent b41e328d22
commit 2a0daae155

View file

@ -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");
}