Skip to content

Commit 567edc5

Browse files
committed
Fixed issue #23
1 parent 8d2daae commit 567edc5

2 files changed

Lines changed: 59 additions & 28 deletions

File tree

src/WGet.NET/HelperClasses/ProcessOutputReader.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public static List<WinGetPackage> ToPackageList(string[] output, PackageAction a
3737
//that will be thrown later, will be catched in the calling method.
3838
int labelLine = ArrayManager.GetEntryContains(output, "------") - 1;
3939

40+
if (labelLine < 0)
41+
{
42+
// Output does not contain any entries
43+
return new List<WinGetPackage>();
44+
}
45+
4046
int[] columnList = GetColumnList(output[labelLine]);
4147

4248
//Remove unneeded output Lines
@@ -203,6 +209,12 @@ public static List<WinGetPinnedPackage> ToPinnedPackageList(string[] output)
203209
//that will be thrown later, will be catched in the calling method.
204210
int labelLine = ArrayManager.GetEntryContains(output, "------") - 1;
205211

212+
if (labelLine < 0)
213+
{
214+
// Output does not contain any entries
215+
return new List<WinGetPinnedPackage>();
216+
}
217+
206218
int[] columnList = GetColumnList(output[labelLine], true);
207219

208220
//Remove unneeded output Lines

src/WGet.NET/XmlDocumentation/WGet.NET.xml

Lines changed: 47 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)