Skip to content

Commit

Permalink
Ensure that scoop export is actually in an old format instead of pars…
Browse files Browse the repository at this point in the history
…ing corrupted json data

Prevents #415
  • Loading branch information
Klocman committed May 20, 2023
1 parent a3fb12f commit 6b868aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/UninstallTools/Factory/ScoopFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ public IList<ApplicationUninstallerEntry> GetUninstallerEntries(ListGenerationPr
name = str;
}

// Make sure that this isn't just a corrupted json export
if (string.Equals(name, "\"apps\":", StringComparison.Ordinal) ||
string.Equals(name, "\"buckets\":", StringComparison.Ordinal))
throw;

var entry = CreateUninstallerEntry(name, version, isGlobal, exeSearcher);

results.Add(entry);
Expand Down

0 comments on commit 6b868aa

Please sign in to comment.