Cleanup null reference fix with correct code practice (#4587)

* Fixed null reference exception on context menu buttons

* Cleaned up fix with correct practices
This commit is contained in:
Arjun Balgovind 2020-06-29 15:47:10 -07:00 committed by GitHub
parent 16e56c4edb
commit 0dd17cc175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,7 @@ namespace Wox.ViewModel
} }
// Result does not contain any context menu items - we don't need to show the context menu ListView at all. // Result does not contain any context menu items - we don't need to show the context menu ListView at all.
if (ContextMenuItems != null && ContextMenuItems.Count > 0) if (ContextMenuItems?.Count > 0)
{ {
AreContextButtonsActive = IsSelected || IsHovered; AreContextButtonsActive = IsSelected || IsHovered;
} }