Merge pull request #780 from Flow-Launcher/FixBookmarkIssueWhen

quick exit when children property is not found
This commit is contained in:
Kevin Zhang 2021-10-30 00:10:43 -05:00 committed by GitHub
commit fac8b76485
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
}
return bookmarks;
}
protected List<Bookmark> LoadBookmarksFromFile(string path, string source)
{
if (!File.Exists(path))
@ -44,7 +44,9 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
private void EnumerateFolderBookmark(JsonElement folderElement, List<Bookmark> bookmarks, string source)
{
foreach (var subElement in folderElement.GetProperty("children").EnumerateArray())
if (!folderElement.TryGetProperty("children", out var childrenElement))
return;
foreach (var subElement in childrenElement.EnumerateArray())
{
switch (subElement.GetProperty("type").GetString())
{