Skip to content

Commit

Permalink
Fix context menu crash when loading from single image
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Nov 3, 2021
1 parent 5beaaf0 commit 33c1d06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PicView/ChangeImage/History.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ internal static void RefreshRecentItemsMenu()
var cm = (MenuItem)ConfigureWindows.MainContextMenu.Items[5];
for (int i = 0; i < maxCount; i++)
{
if (fileHistory.Count == i)
{
return;
}

var item = menuItem(fileHistory[i], i);
if (item is null) { break; }
if (cm.Items.Count <= i)
Expand Down

0 comments on commit 33c1d06

Please sign in to comment.