null check to avoid oops

This commit is contained in:
Adam D. Ruppe 2022-04-05 19:16:03 -04:00
parent 62a1544bda
commit 6560878cd0
1 changed files with 3 additions and 1 deletions

View File

@ -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);