Add guard
This commit is contained in:
@@ -95,14 +95,13 @@ bool JsonSettingsIO::saveState(const CrossPointState& s, const char* path) {
|
|||||||
jump["spineIndex"] = s.pendingBookmarkJump.spineIndex;
|
jump["spineIndex"] = s.pendingBookmarkJump.spineIndex;
|
||||||
jump["pageNumber"] = s.pendingBookmarkJump.pageNumber;
|
jump["pageNumber"] = s.pendingBookmarkJump.pageNumber;
|
||||||
|
|
||||||
FsFile file;
|
if (doc.overflowed()) {
|
||||||
if (!Storage.openFileForWrite("CPS", path, file)) {
|
LOG_ERR("CPS", "JSON document overflowed while building state");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc.overflowed()) {
|
FsFile file;
|
||||||
LOG_ERR("CPS", "JSON document overflowed while building state");
|
if (!Storage.openFileForWrite("CPS", path, file)) {
|
||||||
file.close();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user