From f39c75af5142db5d2fcdcf9f16d6b6cfad8f80c9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 3 Jun 2023 20:56:15 +0200 Subject: Fix "is an object" check in may_remove_shipment. typeof null === "object" for obscure historical reasons. --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 9b10b63..f9553a6 100644 --- a/rules.js +++ b/rules.js @@ -2279,10 +2279,10 @@ states.transfer_dropped_shipments = { function may_remove_shipment() { // Captured Goods - if (typeof game.op === "object" && game.op.type === "Attack") + if (game.op !== null && typeof game.op === "object" && game.op.type === "Attack") return false // Commandeer - if (typeof game.sa === "object" && game.sa.commandeer) + if (game.sa !== null && typeof game.sa === "object" && game.sa.commandeer) return false return true } -- cgit v1.2.3