1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-06-06 14:47:46 +00:00

Remove unwrap in tex parsing

This commit is contained in:
Joshua Goins 2025-06-02 16:59:00 -04:00
parent 1071ae0ccd
commit b0047dd77d
2 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@ impl Texture {
/// Reads an existing TEX file
pub fn from_existing(buffer: ByteSpan) -> Option<Texture> {
let mut cursor = Cursor::new(buffer);
let header = TexHeader::read(&mut cursor).unwrap();
let header = TexHeader::read(&mut cursor).ok()?;
cursor
.seek(SeekFrom::Start(std::mem::size_of::<TexHeader>() as u64))