From 1475b3cba4ff0b35444d0da32c888c3f7d752d78 Mon Sep 17 00:00:00 2001 From: GDN <96800819+GDNgit@users.noreply.github.com> Date: Mon, 27 Feb 2023 10:58:09 -0600 Subject: [PATCH] fixes an EFTPOS runtime if there's no connected account (#20456) * fixes an EFTPOS runtime if there's no connected account * ryan review --- code/modules/economy/economy_machinery/eftpos.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/economy/economy_machinery/eftpos.dm b/code/modules/economy/economy_machinery/eftpos.dm index 22681fa67c6..5826d1db063 100644 --- a/code/modules/economy/economy_machinery/eftpos.dm +++ b/code/modules/economy/economy_machinery/eftpos.dm @@ -182,6 +182,9 @@ return var/datum/money_account/D = GLOB.station_money_database.find_user_account(C.associated_account_number, include_departments = FALSE) + if(!D) + to_chat(user, "Your currently in use card is not connected to a money account.") + return //if security level high enough, prompt for pin var/attempt_pin if(D.security_level != ACCOUNT_SECURITY_ID) @@ -189,7 +192,7 @@ if(!attempt_pin || !Adjacent(user)) return //given the credentials, can the associated account be accessed right now? - if(!D || !GLOB.station_money_database.try_authenticate_login(D, attempt_pin, restricted_bypass = FALSE)) + if(!GLOB.station_money_database.try_authenticate_login(D, attempt_pin, restricted_bypass = FALSE)) to_chat(user, "[bicon(src)]Unable to access account, insufficient access.") return if(alert("Are you sure you want to pay $[transaction_amount] to: [linked_account.account_name] ", "Confirm transaction", "Yes", "No") != "Yes")