From b165638fb3bccd6a7e929420b029c95313acc731 Mon Sep 17 00:00:00 2001 From: Ancurio Date: Wed, 6 Oct 2021 23:43:16 +0200 Subject: [PATCH] FileSystem: Throw exception if openReadRaw fails --- src/filesystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/filesystem.cpp b/src/filesystem.cpp index c03dec6..5be8f83 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -689,7 +689,9 @@ void FileSystem::openReadRaw(SDL_RWops &ops, bool freeOnClose) { PHYSFS_File *handle = PHYSFS_openRead(filename); - assert(handle); + + if (!handle) + throw Exception(Exception::NoFileError, "%s", filename); initReadOps(handle, ops, freeOnClose); }