Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2007-11-21 00:28:26 +0000
committerChris Goldthorpe2007-11-21 00:28:26 +0000
commitf11b7bd669bbeac8fe1ea87834e8eb6c6a11935f (patch)
tree489d3c46cdd66699979178550d504d41445af4c3 /org.eclipse.ui.cheatsheets
parent85763e7a7b84f1e63a363440b14fca144b03745a (diff)
downloadeclipse.platform.ua-f11b7bd669bbeac8fe1ea87834e8eb6c6a11935f.tar.gz
eclipse.platform.ua-f11b7bd669bbeac8fe1ea87834e8eb6c6a11935f.tar.xz
eclipse.platform.ua-f11b7bd669bbeac8fe1ea87834e8eb6c6a11935f.zip
Avoid null pointer check when using OpenCheatSheetFromHelpAction.
Diffstat (limited to 'org.eclipse.ui.cheatsheets')
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
index f790e7972..2a28355df 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
@@ -116,10 +116,9 @@ public final class OpenCheatSheetAction extends Action {
*/
public void run() {
Shell shell = Display.getDefault().getActiveShell();
- Object data = shell.getData();
// are we in a dialog that can show a cheat sheet?
- if (!shell.isFocusControl() && data instanceof TrayDialog) {
- TrayDialog dialog = (TrayDialog)data;
+ if (shell != null && !shell.isFocusControl() && shell.getData() instanceof TrayDialog) {
+ TrayDialog dialog = (TrayDialog)shell.getData();
HelpTray tray = (HelpTray)dialog.getTray();
if (tray == null) {
tray = new HelpTray();

Back to the top