diff --git a/src/sprite.rs b/src/sprite.rs index a72d476..2e51445 100644 --- a/src/sprite.rs +++ b/src/sprite.rs @@ -84,7 +84,11 @@ impl Sprite { return Err(SpriteMissingRoomPosition); } - position = Some(Position::from_str(room_position[1]).unwrap()); + if let Ok(pos) = Position::from_str(room_position[1]) { + position = Some(pos); + } else { + return Err(SpriteMissingRoomPosition); + } } else if last_line.starts_with("COL") { colour_id = Some(last_line.replace("COL ", "").parse().unwrap()); } else if last_line.starts_with("ITM") {