Merge pull request #1359 from eclipse/cd_issue1651

[eclipse/xtext#1651] made error handling in StorageAwareResource null-safe
This commit is contained in:
Christian Dietrich 2020-01-20 13:47:45 +01:00 committed by GitHub
commit bda917bab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -44,8 +44,8 @@ class StorageAwareResource extends LazyLinkingResource {
return;
} catch(IOException e) {
// revert the resource into a clean state
contents.clear
eAdapters.clear
contents?.clear
eAdapters?.clear
unload
}
}

View file

@ -68,8 +68,12 @@ public class StorageAwareResource extends LazyLinkingResource {
return;
} catch (final Throwable _t) {
if (_t instanceof IOException) {
this.contents.clear();
this.eAdapters.clear();
if (this.contents!=null) {
this.contents.clear();
}
if (this.eAdapters!=null) {
this.eAdapters.clear();
}
this.unload();
} else {
throw Exceptions.sneakyThrow(_t);