mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
[eclipse/xtext#1651] made error handling in StorageAwareResource null-safe
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
parent
9d419220eb
commit
6b552f0659
2 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue