diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 39c9cd6e1fba47c6220f9519b0c6e6ccf1ef77ad..e02c059bb277b158e4c58bf1ef5ddf72460e3fb6 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -1110,8 +1110,14 @@ The third category, the "slave slot" is completely optional.  Sometimes you just
 window.cashX = function(cost, what, who) {
 	const V = State.variables;
 
-	if(isNaN(cost)){
-		V.lastWeeksErrors += `NaN: "${cost}" at ${what},
+	if (typeof cost !== "number") {
+		V.lastWeeksErrors += `"${cost}" at ${what} is not of type "number",
+		`;
+	} else if (Number.isNaN(cost)) {
+		V.lastWeeksErrors += `"${cost}" at ${what} is NaN,
+		`;
+	} else if (cost === -Infinity || cost === Infinity) {
+		V.lastWeeksErrors += `"${cost}" at ${what} is infinity,
 		`;
 	} else {