diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/physfsrwops.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index fdf9bc957..e755ea353 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -177,16 +177,22 @@ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle) SDL_RWops *PHYSFSRWOPS_openRead(const char *fname) { + if (!fname || !*fname) + return nullptr; return create_rwops(PHYSFS_openRead(fname)); } /* PHYSFSRWOPS_openRead */ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname) { + if (!fname || !*fname) + return nullptr; return create_rwops(PHYSFS_openWrite(fname)); } /* PHYSFSRWOPS_openWrite */ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname) { + if (!fname || !*fname) + return nullptr; return create_rwops(PHYSFS_openAppend(fname)); } /* PHYSFSRWOPS_openAppend */ |