From 1f9949af28ffe0006ce7e90768ec44a672cfc1fe Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Tue, 14 Apr 2015 18:19:47 +0300 Subject: [PATCH] ui util.isRetina: process IllegalArgumentException as well --- platform/util/src/com/intellij/util/ui/UIUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index b1d27b3c27fb..5bc953b1c891 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -314,13 +314,16 @@ public class UIUtil { } try { - isRetina = (getScaleFactorMethod == null) || ((Integer)getScaleFactorMethod.invoke(device) != 1); + isRetina = getScaleFactorMethod == null || (Integer)getScaleFactorMethod.invoke(device) != 1; } catch (IllegalAccessException e) { LOG.debug("CGraphicsDevice.getScaleFactor(): Access issue"); isRetina = false; } catch (InvocationTargetException e) { LOG.debug("CGraphicsDevice.getScaleFactor(): Invocation issue"); isRetina = false; + } catch (IllegalArgumentException e) { + LOG.debug("object is not an instance of declaring class: " + device.getClass().getName()); + isRetina = false; } devicesToRetinaSupportCacheMap.put(device, isRetina);