From c380cfd248484484eeabc236e6a6e2fb9d4146d8 Mon Sep 17 00:00:00 2001
From: PantyNabber <purepureboy@gmail.com>
Date: Mon, 27 Jun 2022 03:48:03 +0200
Subject: [PATCH] This fixes a bug where r would be accessed by
 ProcessAssignments before it was initialized, causing an exception.

---
 src/js/DefaultRules.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js
index 4cb6389756c..3b8ad831362 100644
--- a/src/js/DefaultRules.js
+++ b/src/js/DefaultRules.js
@@ -8,6 +8,7 @@ globalThis.DefaultRules = function(slave) {
 		return ""; // exempted
 	}
 
+	let r = "";
 	const slaveReadOnly = createReadonlyProxy(slave);
 	const {rule, ruleIds, sourceRecord} = runWithReadonlyProxy(() => ProcessSlaveRules(slaveReadOnly));
 	slave.currentRules = ruleIds;
@@ -15,7 +16,6 @@ globalThis.DefaultRules = function(slave) {
 		return ""; // no rules apply
 	}
 
-	let r = "";
 	const pronouns = getPronouns(slave);
 	const {he, him, his} = pronouns;
 
-- 
GitLab