From 96031a3d617cebebd29c78831abd4d9efc0a5dbb Mon Sep 17 00:00:00 2001 From: mc0239 Date: Mon, 7 Sep 2020 23:06:15 +0200 Subject: [PATCH] Fix NullPointerException if CheckFolders call fails. --- SyncthingStatus/StatusChecker.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SyncthingStatus/StatusChecker.cs b/SyncthingStatus/StatusChecker.cs index b8b4e69..19b470c 100644 --- a/SyncthingStatus/StatusChecker.cs +++ b/SyncthingStatus/StatusChecker.cs @@ -59,11 +59,11 @@ public async Task CheckAll() } FolderResponse[] folders = await CheckFolders(); - // Sort folders by name (Label) - Array.Sort(folders, delegate (FolderResponse f1, FolderResponse f2) { return f1.Label.CompareTo(f2.Label); }); - if (folders != null) { + // Sort folders by name (Label) + Array.Sort(folders, delegate (FolderResponse f1, FolderResponse f2) { return f1.Label.CompareTo(f2.Label); }); + string tmp = ""; foreach (ToolStripDropDownItem item in TrayMenuItemFolders.DropDownItems) {