Skip to content

Commit c94f156

Browse files
committed
[Mac] Fix ClassCastException when selecting a color in FontDialog
- See #1814
1 parent da081e9 commit c94f156

File tree

1 file changed

+4
-3
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets

1 file changed

+4
-3
lines changed

bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5988,9 +5988,10 @@ static long dialogProc(long id, long sel, long arg0) {
59885988

59895989
switch (Selector.valueOf(sel)) {
59905990
case sel_changeColor_: {
5991-
ColorDialog dialog = (ColorDialog)OS.JNIGetObject(jniRef[0]);
5992-
if (dialog == null) return 0;
5993-
dialog.changeColor(id, sel, arg0);
5991+
Object object = OS.JNIGetObject(jniRef[0]);
5992+
if (object instanceof ColorDialog) {
5993+
((ColorDialog)object).changeColor(id, sel, arg0);
5994+
}
59945995
return 0;
59955996
}
59965997
case sel_changeFont_: {

0 commit comments

Comments
 (0)