Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Storage.java15
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)
{

Back to the top