Check for null query when decoding device link uri
This commit is contained in:
parent
263fdceb94
commit
6c8a1ff3d3
@ -21,7 +21,12 @@ public class DeviceLinkInfo {
|
|||||||
final ECPublicKey deviceKey;
|
final ECPublicKey deviceKey;
|
||||||
|
|
||||||
public static DeviceLinkInfo parseDeviceLinkUri(URI linkUri) throws IOException, InvalidKeyException {
|
public static DeviceLinkInfo parseDeviceLinkUri(URI linkUri) throws IOException, InvalidKeyException {
|
||||||
Map<String, String> query = getQueryMap(linkUri.getRawQuery());
|
final String rawQuery = linkUri.getRawQuery();
|
||||||
|
if (isEmpty(rawQuery)) {
|
||||||
|
throw new RuntimeException("Invalid device link uri");
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> query = getQueryMap(rawQuery);
|
||||||
String deviceIdentifier = query.get("uuid");
|
String deviceIdentifier = query.get("uuid");
|
||||||
String publicKeyEncoded = query.get("pub_key");
|
String publicKeyEncoded = query.get("pub_key");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user