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:
parent
0ee87e0c9a
commit
7b13873955
2 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||||
int lineNumber= document.getLineOfOffset(getDocumentOffset(fTextWidget.getCaretOffset()));
|
if (document != null) {
|
||||||
|
int lineNumber= document.getLineOfOffset(getDocumentOffset(fTextWidget.getCaretOffset()));
|
||||||
fCursorLine.isDeleted= false;
|
|
||||||
fCursorLine.offset= document.getLineOffset(lineNumber);
|
fCursorLine.isDeleted= false;
|
||||||
fCursorLine.length= 0;
|
fCursorLine.offset= document.getLineOffset(lineNumber);
|
||||||
|
fCursorLine.length= 0;
|
||||||
|
}
|
||||||
} catch (BadLocationException e) {
|
} catch (BadLocationException e) {
|
||||||
// gracefully ignored
|
// gracefully ignored
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue