Skip to content

Commit 5582dcb

Browse files
(#48) Fix NRE when TaskDialog does not have buttons
1 parent 2cacf5e commit 5582dcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Ookii.Dialogs.Wpf/TaskDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ public TaskDialogButton ShowDialog(IntPtr owner)
11231123
if( IsDialogRunning )
11241124
throw new InvalidOperationException(Properties.Resources.TaskDialogRunningError);
11251125

1126-
if( _buttons.Count == 0 )
1126+
if (_buttons is null || _buttons.Count == 0)
11271127
throw new InvalidOperationException(Properties.Resources.TaskDialogNoButtonsError);
11281128

11291129
_config.hwndParent = owner;

0 commit comments

Comments
 (0)