From dcc94004839ae7ad50e303d16b4dd243d68d1e71 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 27 Apr 2022 14:15:54 +0900 Subject: [PATCH] back-end: Minor fix related to phrase handling Fixes passing an empty string to the db in (probably) rare cases. --- back_end/src/json_handlers.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()); + } } } }