From 708d7fd989fc645a09e956b90c7a1ad5ce4e9f2b Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 3 Oct 2017 13:26:16 +0500 Subject: [PATCH] TaskTasix: Don't process empty response. --- src/ui/task/tasktasix.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/ui/task/tasktasix.cpp b/src/ui/task/tasktasix.cpp index cf8bd492..bd3fbf65 100644 --- a/src/ui/task/tasktasix.cpp +++ b/src/ui/task/tasktasix.cpp @@ -106,13 +106,6 @@ QString TaskTasix::parseBufer(const QByteArray &buffer) { QStringList list; - // Include local networks - list.append("10.0.0.0/8"); - list.append("127.0.0.0/8"); - list.append("169.254.0.0/16"); - list.append("172.16.0.0/12"); - list.append("192.168.0.0/16"); - // Parse lines const QString text(buffer); foreach (const QStringRef &line, text.splitRef('\n')) { @@ -132,6 +125,16 @@ QString TaskTasix::parseBufer(const QByteArray &buffer) list.append(addrStr.toString()); } + if (list.isEmpty()) + return QString(); + + // Include local networks + list.append("10.0.0.0/8"); + list.append("127.0.0.0/8"); + list.append("169.254.0.0/16"); + list.append("172.16.0.0/12"); + list.append("192.168.0.0/16"); + // Merge lines Ip4Range ip4Range; if (!ip4Range.fromText(list.join('\n')))