From d36249d67d52aedaed79f55a150ab48075a5136c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 30 Mar 2020 18:21:29 +0200 Subject: [PATCH] 1.10.8 Bugfix: Fixed net use parser for empty result --- src/main/de/jClipCorn/util/helper/ApplicationHelper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/de/jClipCorn/util/helper/ApplicationHelper.java b/src/main/de/jClipCorn/util/helper/ApplicationHelper.java index e9c55670..7267c946 100644 --- a/src/main/de/jClipCorn/util/helper/ApplicationHelper.java +++ b/src/main/de/jClipCorn/util/helper/ApplicationHelper.java @@ -146,7 +146,14 @@ public static List> getNetUse() throws Ex String[] lines = out.Item2.split("\\r\\n"); int start = CCStreams.iterate(lines).findIndex(l -> Pattern.matches("^-----+$", l.trim())); - if (start == -1 || start == 0) throw new Exception("Parser Error: Table start not found"); + if (start == -1 || start == 0) + { + if (CCStreams.iterate(lines).any(p -> p.toLowerCase().contains("error"))) throw new Exception("Parser Error: Table start not found (+error)"); + + if (CCStreams.iterate(lines).count(p -> !Str.isNullOrWhitespace(p)) <= 2) return new ArrayList<>(); // No entries in list + + throw new Exception("Parser Error: Table start not found"); + } String header = lines[start - 1];