From: Stephen Seo Date: Wed, 27 Apr 2022 05:15:54 +0000 (+0900) Subject: back-end: Minor fix related to phrase handling X-Git-Tag: sprint_06_day_3~3 X-Git-Url: https://git.seodisparate.com/tbm-server-edit-set-haste.png?a=commitdiff_plain;h=dcc94004839ae7ad50e303d16b4dd243d68d1e71;p=EN605.607.81.SP22_ASDM_Project back-end: Minor fix related to phrase handling Fixes passing an empty string to the db in (probably) rare cases. --- diff --git a/back_end/src/json_handlers.rs b/back_end/src/json_handlers.rs index acacafa..e10a62f 100644 --- a/back_end/src/json_handlers.rs +++ b/back_end/src/json_handlers.rs @@ -56,7 +56,10 @@ fn handle_pairing_request(root: Value, tx: SyncSender) -> Resu phrase_str = phrase_str.split_at(idx).0; } } - phrase = Some(phrase_str.to_owned()); + + if !phrase_str.is_empty() { + phrase = Some(phrase_str.to_owned()); + } } } }