From c50dee31ea8404aab530eb98162454d386730106 Mon Sep 17 00:00:00 2001 From: Phillip Dykman Date: Sun, 8 Dec 2019 11:12:47 -0800 Subject: [PATCH] Fix parsing bug - seq_dl and f_l_piece_prio can be missing if the torrent is new and hasn't downloaded metadata yet --- .../transdroid/daemon/Qbittorrent/QbittorrentAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java index 7f693b8f..b54452b4 100644 --- a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java @@ -521,8 +521,12 @@ public class QbittorrentAdapter implements IDaemonAdapter { ratio = tor.getDouble("ratio"); dlspeed = tor.getInt("dlspeed"); upspeed = tor.getInt("upspeed"); - dlseq = tor.getBoolean("seq_dl"); - dlflp = tor.getBoolean("f_l_piece_prio"); + if (tor.has("seq_dl")) { + dlseq = tor.getBoolean("seq_dl"); + } + if (tor.has("f_l_piece_prio")) { + dlflp = tor.getBoolean("f_l_piece_prio"); + } if (tor.has("uploaded")) { uploaded = tor.getLong("uploaded"); } else {