summaryrefslogtreecommitdiff
path: root/assets/charsheet/charsheet.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/charsheet/charsheet.js')
-rw-r--r--assets/charsheet/charsheet.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/assets/charsheet/charsheet.js b/assets/charsheet/charsheet.js
index 108cd14..c43a2b2 100644
--- a/assets/charsheet/charsheet.js
+++ b/assets/charsheet/charsheet.js
@@ -274,7 +274,10 @@ async function fetchUser(uid) {
for (let nm in info.properties) {
setField(nm, info.properties[nm]);
}
- setField("unallocated", info.stats["talentpoints"] - info.stats["allocatedtalentpoints"]);
+ setField(
+ "unallocated",
+ (info.stats["talentpoints"] || 0) - (info.stats["allocatedtalentpoints"] || 0)
+ );
const badges = document.getElementById("badges");
if (badges) {
const badges_resp = await fetch(`${globalThis.apiServer}/user/badges/${uid}`);