lovr.filesystem.write: Fix unintended erroring behavior;

This commit is contained in:
bjorn 2018-10-28 19:46:31 -07:00
parent 654b894ded
commit 987b24fd19
1 changed files with 4 additions and 1 deletions

View File

@ -313,7 +313,10 @@ size_t lovrFilesystemWrite(const char* path, const char* content, size_t size, b
return 0;
}
lovrFileOpen(file, append ? OPEN_APPEND : OPEN_WRITE);
if (lovrFileOpen(file, append ? OPEN_APPEND : OPEN_WRITE)) {
return 0;
}
size_t bytesWritten = lovrFileWrite(file, (void*) content, size);
lovrFileClose(file);
lovrRelease(file);