From 6560878cd078329345320a06c092c9fc1537d66a Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Tue, 5 Apr 2022 19:16:03 -0400 Subject: [PATCH] null check to avoid oops --- simpledisplay.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simpledisplay.d b/simpledisplay.d index 5da96dd..c9eff53 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -2897,8 +2897,10 @@ class SimpleWindow : CapableOfHandlingNativeEvent, CapableOfBeingDrawnUpon { private Image secret_icon_inner; - /// Set the icon that is seen in the title bar or taskbar, etc., for the user. + /// Set the icon that is seen in the title bar or taskbar, etc., for the user. If passed `null`, does nothing. @property void icon(MemoryImage icon) { + if(icon is null) + return; auto tci = icon.getAsTrueColorImage(); version(Windows) { winIcon = new WindowsIcon(icon);