diff options
author | Kay Ramme <kr@openoffice.org> | 2001-08-30 14:30:06 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2001-08-30 14:30:06 +0000 |
commit | ed1970cd2c5ad344ccffceb652a475ce7ef23360 (patch) | |
tree | 3feb6cd990df7e56adcd2141b3218ff716556b9e /sj2 | |
parent | e44d0f5645687809f1e46b2892a50d0f4b6c74c8 (diff) |
exception messages may be empty (#91743#)
Diffstat (limited to 'sj2')
-rw-r--r-- | sj2/source/jscpp/sjapplet_impl.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sj2/source/jscpp/sjapplet_impl.cxx b/sj2/source/jscpp/sjapplet_impl.cxx index 26cd350e03..11b8db43d5 100644 --- a/sj2/source/jscpp/sjapplet_impl.cxx +++ b/sj2/source/jscpp/sjapplet_impl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sjapplet_impl.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: pl $ $Date: 2001-08-15 11:21:55 $ + * last change: $Author: kr $ $Date: 2001-08-30 15:30:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -129,10 +129,13 @@ static void testJavaException(JNIEnv * pEnv) throw(com::sun::star::uno::Runtime jmethodID jmThrowable_getMessage = pEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;"); jstring jsMessage = (jstring)pEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage); - - const jchar * jcMessage = pEnv->GetStringChars(jsMessage, NULL); - OUString ouMessage(jcMessage); - pEnv->ReleaseStringChars(jsMessage, jcMessage); + + OUString ouMessage; + if(jsMessage) { + const jchar * jcMessage = pEnv->GetStringChars(jsMessage, NULL); + ouMessage = OUString(jcMessage); + pEnv->ReleaseStringChars(jsMessage, jcMessage); + } throw RuntimeException(ouMessage, Reference<XInterface>()); } |