Skip to content

Commit

Permalink
NullPointerException on start #197
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Bossert <[email protected]>
  • Loading branch information
anb0s committed Jan 15, 2022
1 parent af0eb93 commit 3a32a23
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions plugin/src/de/anbos/eclipse/easyshell/plugin/misc/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

public class Utils {

/* tooltip display parameters */
static boolean TOOLTIP_USE_SWT_JFACE = true; /*bug: https://github.com/anb0s/EasyShell/issues/103*/
// tooltip display parameters
static boolean TOOLTIP_USE_SWT_JFACE = true; // bug: https://github.com/anb0s/EasyShell/issues/103
static int TOOLTIP_HIDE_DELAY = 3000;

public static OS getOS() {
Expand Down Expand Up @@ -225,13 +225,16 @@ public static void showToolTip(Control control, int style, String title, String
if (control == null) {
control = Display.getDefault().getActiveShell();
}
/*bug: https://github.com/anb0s/EasyShell/issues/103*/
if (TOOLTIP_USE_SWT_JFACE) {
// the SWT JFace tooltip (hide delay customization)
showToolTipSWTJface(control, style, title, message);
} else {
// the SWT to OS tooltip control (fixed delay)
showToolTipSWTwidget(control, style, title, message);
// prevent NPE, see: https://github.com/anb0s/EasyShell/issues/197
if (control != null) {
// issue: https://github.com/anb0s/EasyShell/issues/103
if (TOOLTIP_USE_SWT_JFACE) {
// the SWT JFace tooltip (hide delay customization)
showToolTipSWTJface(control, style, title, message);
} else {
// the SWT to OS tooltip control (fixed delay)
showToolTipSWTwidget(control, style, title, message);
}
}
}

Expand Down

0 comments on commit 3a32a23

Please sign in to comment.