diff options
Diffstat (limited to 'org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java')
-rw-r--r-- | org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java index b3d1721..1e63f95 100644 --- a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java +++ b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java @@ -376,19 +376,24 @@ public final class Storage implements IStorage cacheStream = null; // Avoid closing the result stream in the finally block return cacheStreamResult; } + } + + IOUtil.closeSilent(cacheStream); + if (cache != null) + { OutputStream output = cache.internalGetOutputStream(applicationToken, key, properties); - return new TeeInputStream(contents, output); + if (output != null) + { + return new TeeInputStream(contents, output); + } } return contents; } catch (NotFoundException ex) { - if (cacheStream != null) - { - IOUtil.closeSilent(cacheStream); - } + IOUtil.closeSilent(cacheStream); if (cache != null) { |