summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-01-13 17:21:06 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-01-16 13:18:27 +0100
commit93af5460feb66086a25a83b80fd5a16a184e07d3 (patch)
treef5c412611e8d72aa2e5005e4654a460db5e71eaf /desktop
parent1b75735c5f487e6e8d5e056ee18d79aec8113570 (diff)
jni: if documentLoad returns NULL don't call NewDirectByteBuffer
Change-Id: I847a7b90c0f85bb59869ecaca037145221e16e7f
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/lokandroid.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index 773cba54a12f..cd3f6b5ea77d 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -138,6 +138,10 @@ extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_Office_docume
LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject);
LibreOfficeKitDocument* pDocument = pLibreOfficeKit->pClass->documentLoad(pLibreOfficeKit, aCloneDocumentPath);
+
+ if (pDocument == NULL)
+ return NULL;
+
jobject aHandle = pEnv->NewDirectByteBuffer((void*) pDocument, sizeof(LibreOfficeKitDocument));
return aHandle;