From 7dce9c4fb9ac641c9612ce3eba774411a1258cc1 Mon Sep 17 00:00:00 2001 From: Christoffer Lantz Date: Sun, 28 Jul 2019 20:32:13 +0200 Subject: [PATCH] Added unwrap_or to obj_str_opt in handle_object in case we don't return early in the _ => match arm --- server/src/cmd.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index f12c2070f5..8edb5c6e69 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -627,7 +627,10 @@ fn handle_object(server: &mut Server, entity: EcsEntity, args: String, _action: .build(); server.clients.notify( entity, - ServerMsg::private(format!("Spawned: {}", obj_str_res.unwrap())), + ServerMsg::private(format!( + "Spawned: {}", + obj_str_res.unwrap_or("") + )), ); } else { server