1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 07:55:24 +02:00

Patch form Thomas Fletcher to fix a NullPointerException.

This commit is contained in:
Alain Magloire 2002-10-11 13:30:21 +00:00
parent cede94d323
commit f076b37dfa
2 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
2002-10-11 Alain Magloire
* CEditorTextHoverDispatcher.java (getCurrentTextHover):
This fixes a null pointer exception received when we hover
over the code in the C/C++ Editor colour preference dialog.
From Thomas Fletcher.

View file

@ -47,9 +47,9 @@ public class CEditorTextHoverDispatcher implements ITextHover
private ITextHover getCurrentTextHover() private ITextHover getCurrentTextHover()
{ {
IWorkbenchPage page = fEditor.getSite().getPage(); IWorkbenchPage page;
if ( page != null ) if(fEditor != null && fEditor.getSite() != null &&
{ (page = fEditor.getSite().getPage()) != null) {
Object textHover = fTextHovers.get( page.getPerspective().getId() ); Object textHover = fTextHovers.get( page.getPerspective().getId() );
if ( textHover != null && textHover instanceof ITextHover ) if ( textHover != null && textHover instanceof ITextHover )
return (ITextHover)textHover; return (ITextHover)textHover;