提交 126db5be 编写于 作者: S serb

7124339: [macosx] setIconImage is not endlessly tolerant to the broken image-arguments

Reviewed-by: alexsch, leonidr
上级 fe3bdac4
...@@ -830,18 +830,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo ...@@ -830,18 +830,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// UTILITY METHODS // UTILITY METHODS
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
/* /**
* Find image to install into Title or into Application icon. * Find image to install into Title or into Application icon. First try
* First try icons installed for toplevel. If there is no icon * icons installed for toplevel. Null is returned, if there is no icon and
* use default Duke image. * default Duke image should be used.
* This method shouldn't return null.
*/ */
private CImage getImageForTarget() { private CImage getImageForTarget() {
List<Image> icons = target.getIconImages(); CImage icon = null;
if (icons == null || icons.size() == 0) { try {
return null; icon = CImage.getCreator().createFromImages(target.getIconImages());
} catch (Exception ignored) {
// Perhaps the icon passed into Java is broken. Skipping this icon.
} }
return CImage.getCreator().createFromImages(icons); return icon;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册