Added unwrap_or to obj_str_opt in handle_object in case we don't return early in the _ => match arm

This commit is contained in:
Christoffer Lantz 2019-07-28 20:32:13 +02:00 committed by Imbris
parent c154a41c5c
commit 7dce9c4fb9

View File

@ -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("<Unknown object>")
)),
);
} else {
server