From 610b89cd19f96e63dba6a479a8fe8163fe0bcbfe Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sun, 20 Feb 2011 01:00:27 +0100 Subject: [PATCH] Handle PHYSFS_fileExists failing with empty strings on windows --- src/modules/filesystem/physfs/File.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/filesystem/physfs/File.cpp b/src/modules/filesystem/physfs/File.cpp index fecd585f1..678b687fc 100644 --- a/src/modules/filesystem/physfs/File.cpp +++ b/src/modules/filesystem/physfs/File.cpp @@ -110,8 +110,8 @@ namespace physfs { bool isOpen = (file != 0); - if(!isOpen) - open(READ); + if(!isOpen && !open(READ)) + throw love::Exception("Could not read file %s.", filename.c_str()); int max = (int)PHYSFS_fileLength(file); size = (size == ALL) ? max : size;