Browse Source

remove unwrap

pbs
Andy Newjack 5 years ago
parent
commit
36ee49d28e
  1. 4
      src/ship/ship.rs

4
src/ship/ship.rs

@ -267,7 +267,9 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> {
}
},
RecvShipPacket::RoomPasswordReq(room_password_req) => {
if room_password_req.password == self.rooms[room_password_req.item as usize].as_ref().unwrap().password {
if room_password_req.password == self.rooms[room_password_req.item as usize].as_ref()
.ok_or(ShipError::InvalidRoom(room_password_req.item))?
.password {
let menuselect = MenuSelect {
menu: room_password_req.menu,
item: room_password_req.item,

Loading…
Cancel
Save