From 9e85be8fe69371e310899e2f89585568d41d362a Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Mon, 4 Jan 2021 18:53:23 -0800
Subject: [PATCH] Setter needs to return true even when the scan pointer is
 NULL

(e.g. when run as a timed event) - this bug was introduced in the "Fix sub[] property setter" crash bug fix 2 commits ago.
This fixes the "TypeError: sub.code is undefined" error.
---
 src/sbbs3/js_msg_area.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/js_msg_area.c b/src/sbbs3/js_msg_area.c
index 289171b444..a6737c005b 100644
--- a/src/sbbs3/js_msg_area.c
+++ b/src/sbbs3/js_msg_area.c
@@ -315,7 +315,7 @@ static JSBool js_sub_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, j
 
 	subscan_t*	scan = p->subscan;
 	if(scan == NULL)
-		return JS_FALSE;
+		return JS_TRUE;
 
     JS_IdToValue(cx, id, &idval);
     tiny = JSVAL_TO_INT(idval);
-- 
GitLab