ZVISION: Test for file.open before trying to read
This commit is contained in:
parent
0feac806b2
commit
f89120310c
1 changed files with 4 additions and 1 deletions
|
@ -33,7 +33,10 @@ namespace ZVision {
|
||||||
|
|
||||||
void writeFileContentsToFile(const Common::String &sourceFile, const Common::String &destFile) {
|
void writeFileContentsToFile(const Common::String &sourceFile, const Common::String &destFile) {
|
||||||
Common::File f;
|
Common::File f;
|
||||||
f.open(sourceFile);
|
if (!f.open(sourceFile)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
byte* buffer = new byte[f.size()];
|
byte* buffer = new byte[f.size()];
|
||||||
f.read(buffer, f.size());
|
f.read(buffer, f.size());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue