Skip to content

Commit d10d7e4

Browse files
arunjose696akoch-yatta
authored andcommitted
Fix null pointer when drawable of a GC is null
The drawable on a GC can be null this would result in a null pointer error in GC#calculateZoomForImage as we check if the drawable is not autoScalable.
1 parent 00106b4 commit d10d7e4

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ private int calculateZoomForImage(int gcZoom, int srcWidth, int srcHeight, int d
11481148
// unscaled images can use the GC zoom
11491149
return gcZoom;
11501150
}
1151-
if (!drawable.isAutoScalable()) {
1151+
if (drawable != null && !drawable.isAutoScalable()) {
11521152
return gcZoom;
11531153
}
11541154

0 commit comments

Comments
 (0)