1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix NPE and CCE

This commit is contained in:
Anton Leherbauer 2006-11-21 15:57:37 +00:00
parent 0ee87e0c9a
commit 7b13873955
2 changed files with 8 additions and 8 deletions

View file

@ -502,14 +502,14 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
*/ */
private void updateCursorLine() { private void updateCursorLine() {
try { try {
IDocument document= fTextViewer.getDocument(); IDocument document= fTextViewer.getDocument();
if (document != null) {
int lineNumber= document.getLineOfOffset(getDocumentOffset(fTextWidget.getCaretOffset())); int lineNumber= document.getLineOfOffset(getDocumentOffset(fTextWidget.getCaretOffset()));
fCursorLine.isDeleted= false; fCursorLine.isDeleted= false;
fCursorLine.offset= document.getLineOffset(lineNumber); fCursorLine.offset= document.getLineOffset(lineNumber);
fCursorLine.length= 0; fCursorLine.length= 0;
}
} catch (BadLocationException e) { } catch (BadLocationException e) {
// gracefully ignored // gracefully ignored
} }

View file

@ -44,7 +44,7 @@ public class ExternalSearchDocumentProvider extends FileDocumentProvider {
FileInfo info= new FileInfo(d, m, null); FileInfo info= new FileInfo(d, m, null);
return info; return info;
} }
return null; return super.createElementInfo(element);
} }
/** /**