ZVISION: Test for file.open before trying to read

This commit is contained in:
richiesams 2013-08-09 14:52:21 -05:00
parent 0feac806b2
commit f89120310c

View File

@ -33,7 +33,10 @@ namespace ZVision {
void writeFileContentsToFile(const Common::String &sourceFile, const Common::String &destFile) {
Common::File f;
f.open(sourceFile);
if (!f.open(sourceFile)) {
return;
}
byte* buffer = new byte[f.size()];
f.read(buffer, f.size());