From 1e66e835791272cddd12bd01acdb2d2cb5dee687 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Fri, 22 May 2020 12:16:41 -0700
Subject: [PATCH] Be tolerant of bad subslave targets (not sure how this
 happens, but it does).

---
 src/js/slaveListing.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js
index 9aa9560067b..b97674baaa0 100644
--- a/src/js/slaveListing.js
+++ b/src/js/slaveListing.js
@@ -314,7 +314,12 @@ App.UI.SlaveList.render = function() {
 			if (slave.subTarget === -1) {
 				assignment.innerText += ", serving as your Stud";
 			} else if (slave.subTarget !== 0) {
-				assignment.innerText += ", serving " + SlaveFullName(slaves[V.slaveIndices[slave.subTarget]]) + " exclusively";
+				const domSlave = getSlave(slave.subTarget);
+				if (domSlave) {
+					assignment.innerText += ", serving " + SlaveFullName(domSlave) + " exclusively";
+				} else {
+					slave.subTarget = 0;
+				}
 			}
 		}
 		assignment.innerText += ".";
-- 
GitLab