Skip to content

Commit

Permalink
1.10.8 Bugfix: Fixed net use parser for empty result
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikescher committed Mar 30, 2020
1 parent a313c33 commit d36249d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/de/jClipCorn/util/helper/ApplicationHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ public static List<Tuple4<String, String, String, String>> 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];

Expand Down

0 comments on commit d36249d

Please sign in to comment.