Avoid calling iconSize method on a null pointer.

This commit is contained in:
Wolfgang Lux 2018-08-05 11:18:32 +02:00
parent 0e1c392ff0
commit 397a4116cc
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2018-08-05 <wolfgang.lux@gmail.com>
* Source/NSApplication.m (-setApplicationIconImage:): Avoid
calling iconSize method on a null pointer.
2018-08-03 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSApplication.m (-applicationIconImage): Lazy load the

View file

@ -2369,6 +2369,7 @@ image.</p><p>See Also: -applicationIconImage</p>
NSImage *old_app_icon = _app_icon;
NSSize miniWindowSize;
NSSize imageSize;
GSDisplayServer *server;
// Ignore attempts to set nil as the icon image.
if (nil == anImage)
@ -2379,7 +2380,8 @@ image.</p><p>See Also: -applicationIconImage</p>
// Use a copy as we change the name and size
ASSIGNCOPY(_app_icon, anImage);
miniWindowSize = [GSCurrentServer() iconSize];
server = GSCurrentServer();
miniWindowSize = server != 0 ? [server iconSize] : NSZeroSize;
if (miniWindowSize.width <= 0 || miniWindowSize.height <= 0)
{
miniWindowSize = NSMakeSize(48, 48);