2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Do not send null NetworkPackets

Summary: queuedSendUriList can return null and subsequently an attempt is make to actually send this null packet

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17384
This commit is contained in:
Erik Duisters
2018-12-06 16:55:58 +01:00
parent 514f2a2035
commit 27f8c57c50

View File

@@ -284,7 +284,11 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack
//Read all the data early, as we only have permissions to do it while the activity is alive
final ArrayList<NetworkPacket> toSend = new ArrayList<>();
for (Uri uri : uriList) {
toSend.add(uriToNetworkPacket(context, uri));
NetworkPacket np = uriToNetworkPacket(context, uri);
if (np != null) {
toSend.add(np);
}
}
//Callback that shows a progress notification