mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
Fix NPE
This commit is contained in:
parent
08fcfc863a
commit
34c2c311e2
@ -249,8 +249,12 @@ public class LanLinkProvider extends BaseLinkProvider {
|
||||
writer.write(myIdentity.serialize().getBytes(Charsets.UTF_8));
|
||||
writer.flush();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
|
||||
String line = reader.readLine();
|
||||
if (line == null) {
|
||||
throw new JSONException("Can't read line");
|
||||
}
|
||||
// Do not trust the identity packet we received unencrypted
|
||||
secureIdentityPacket = NetworkPacket.unserialize(reader.readLine());
|
||||
secureIdentityPacket = NetworkPacket.unserialize(line);
|
||||
if (!DeviceInfo.isValidIdentityPacket(secureIdentityPacket)) {
|
||||
throw new JSONException("Invalid identity packet");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user