From b0db2ba3470456cf47df3a7e1fdabee63e35ca82 Mon Sep 17 00:00:00 2001 From: JimTheCactus Date: Fri, 25 Jul 2014 19:36:58 -0600 Subject: [PATCH] Added check for blank on name entry Since cancel just returns a blank this checks for that and doesn't raise an error. --- code/modules/client/preferences.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 9a14b8fbff..ab89dccd5d 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -943,11 +943,13 @@ datum/preferences if("input") switch(href_list["preference"]) if("name") - var/new_name = reject_bad_name( input(user, "Choose your character's name:", "Character Preference") as text|null ) - if(new_name) - real_name = new_name - else - user << "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and ." + var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null + if (raw_name) // Check to ensure that the user entered text (rather than cancel.) + var/new_name = reject_bad_name(raw_name) + if(new_name) + real_name = new_name + else + user << "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and ." if("age") var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null