mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 00:38:56 +00:00
null checks added
This commit is contained in:
parent
87c30892b7
commit
9a90cf75bf
1 changed files with 10 additions and 6 deletions
|
@ -54,16 +54,20 @@ public class XtextResource extends ResourceImpl {
|
|||
int length = change.length();
|
||||
int documentGrowth = length - rootNode.getLength();
|
||||
int originalLength = length - documentGrowth;
|
||||
|
||||
// unloading is required to ensure that any EObjects hanging around (e.g. in the outline) get a proxied URI
|
||||
|
||||
// unloading is required to ensure that any EObjects hanging around
|
||||
// (e.g. in the outline) get a proxied URI
|
||||
// and thus still can be compared by their URI
|
||||
unload();
|
||||
|
||||
|
||||
parseResult = parser.reparse(rootNode, offset, originalLength, change);
|
||||
getContents().clear();
|
||||
getContents().add(parseResult.getRootASTElement());
|
||||
if (parseResult != null && parseResult.getRootNode() != rootNode) {
|
||||
addNodeContentAdapter();
|
||||
if (parseResult != null) {
|
||||
if (parseResult.getRootASTElement() != null)
|
||||
getContents().add(parseResult.getRootASTElement());
|
||||
if (parseResult.getRootNode() != rootNode) {
|
||||
addNodeContentAdapter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue