[Fate Core v2] Fix runtime errors (#5655)

`isNullOrWhitespace()` expects a string but sometimes receives a number, so I added a check for that. Also, `tim()` is clearly a typo.
This commit is contained in:
player-03
2019-11-11 12:38:51 -06:00
committed by Cassie Levett
parent 8bffd26199
commit 267ebcb312
+3 -3
View File
@@ -1862,7 +1862,7 @@
newRowAttrs["repeating_stress_" + newRowId + "_usable"] = stressMax;
if (!isNullOrWhitespace(skill)) {
newRowAttrs["repeating_stress_" + newRowId + "_skill"] = skill.tim();
newRowAttrs["repeating_stress_" + newRowId + "_skill"] = skill.trim();
newRowAttrs["repeating_stress_" + newRowId + "_bound"] = 1;
}
@@ -2448,5 +2448,5 @@
});
}
const isNullOrWhitespace = (attr) => !(attr && attr.trim() && attr.trim() != "0");
</script>
const isNullOrWhitespace = (attr) => !(attr && (attr.trim ? attr.trim() && attr.trim() != "0" : attr > 0));
</script>