diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 276530efa867c2ecd3f3e8d6f0cf00482e3832df..3dae0bfb86bf139e1d9f1cd808abf1582f960ed6 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -871,7 +871,6 @@ js_alert(JSContext *cx, uintN argc, jsval *arglist)
 {
 	JSObject *obj=JS_THIS_OBJECT(cx, arglist);
 	jsval *argv=JS_ARGV(cx, arglist);
-    JSString *	str;
 	sbbs_t*		sbbs;
 	jsrefcount	rc;
 	char		*cstr;
@@ -902,13 +901,15 @@ js_confirm(JSContext *cx, uintN argc, jsval *arglist)
 {
 	JSObject *obj=JS_THIS_OBJECT(cx, arglist);
 	jsval *argv=JS_ARGV(cx, arglist);
-    JSString *	str;
 	sbbs_t*		sbbs;
 	jsrefcount	rc;
 	char		*cstr;
 
 	JS_SET_RVAL(cx, arglist, JSVAL_VOID);
 
+	if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
+		return(JS_FALSE);
+
 	JSVALUE_TO_STRING(cx, argv[0], cstr, NULL);
 	if(cstr==NULL)
 	    return(JS_FALSE);
@@ -924,7 +925,6 @@ js_deny(JSContext *cx, uintN argc, jsval *arglist)
 {
 	JSObject *obj=JS_THIS_OBJECT(cx, arglist);
 	jsval *argv=JS_ARGV(cx, arglist);
-    JSString *	str;
 	sbbs_t*		sbbs;
 	jsrefcount	rc;
 	char		*cstr;