From d80d6c5a2ddea6a29f4c9fbea4c4d66f09420cd9 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Fri, 20 Apr 2001 06:20:42 +0000 Subject: [PATCH] Fix for bug #76677. r=beard, sr=brendan, a=asa. --- modules/oji/src/jvmmgr.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/oji/src/jvmmgr.cpp b/modules/oji/src/jvmmgr.cpp index bb88663a119..8118f42ce4d 100644 --- a/modules/oji/src/jvmmgr.cpp +++ b/modules/oji/src/jvmmgr.cpp @@ -141,12 +141,16 @@ JVM_AddToClassPath(const char* dirPath) static nsIJVMConsole* GetConsole(void) { - nsIJVMConsole* console = NULL; + // PENDING(edburns): workaround for bug 76677, make sure the JVM is + // started. + JNIEnv* env = JVM_GetJNIEnv(); + if (!env) + return nsnull; + + nsIJVMConsole* console = nsnull; nsIJVMPlugin* jvm = GetRunningJVM(); - if (jvm) { + if (jvm) jvm->QueryInterface(kIJVMConsoleIID, (void**)&console); - // jvm->Release(); // GetRunningJVM no longer calls AddRef - } return console; }