summaryrefslogtreecommitdiffstats
path: root/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/hsqldb/HStorageAccess.cxx')
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageAccess.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
index 09ab485d9fd7..f4f67a8e394a 100644
--- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
@@ -148,28 +148,28 @@ jint read_from_storage_stream( JNIEnv * env, jstring name, jstring key )
std::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
Reference< XInputStream> xIn = pHelper ? pHelper->getInputStream() : Reference< XInputStream>();
OSL_ENSURE(xIn.is(),"Input stream is NULL!");
- if ( xIn.is() )
+ if ( !xIn.is() )
+ return -1;
+
+ Sequence< ::sal_Int8 > aData(1);
+ sal_Int32 nBytesRead = -1;
+ try
{
- Sequence< ::sal_Int8 > aData(1);
- sal_Int32 nBytesRead = -1;
- try
- {
- nBytesRead = xIn->readBytes(aData,1);
- }
- catch(const Exception& e)
- {
- StorageContainer::throwJavaException(e,env);
- return -1;
+ nBytesRead = xIn->readBytes(aData,1);
+ }
+ catch(const Exception& e)
+ {
+ StorageContainer::throwJavaException(e,env);
+ return -1;
- }
- if (nBytesRead <= 0)
- {
- return -1;
- }
- else
- {
- return static_cast<unsigned char>(aData[0]);
- }
+ }
+ if (nBytesRead <= 0)
+ {
+ return -1;
+ }
+ else
+ {
+ return static_cast<unsigned char>(aData[0]);
}
return -1;
}