Mercurial > dwindows
diff mac/dw.m @ 1709:de49c1f284b2
Safety check for the icon resize code on Mac and GTK.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 05 May 2012 21:41:57 +0000 |
parents | cc10082567ed |
children | daa59fc8d6e5 |
line wrap: on
line diff
--- a/mac/dw.m Sat May 05 21:32:50 2012 +0000 +++ b/mac/dw.m Sat May 05 21:41:57 2012 +0000 @@ -6819,14 +6819,17 @@ /* Internal function to keep HICNs from getting too big */ void _icon_resize(NSImage *image) { - NSSize size = [image size]; - if(size.width > 24 || size.height > 24) - { - if(size.width > 24) - size.width = 24; - if(size.height > 24) - size.height = 24; - [image setSize:size]; + if(image) + { + NSSize size = [image size]; + if(size.width > 24 || size.height > 24) + { + if(size.width > 24) + size.width = 24; + if(size.height > 24) + size.height = 24; + [image setSize:size]; + } } }