Skip to content

Commit 64f4dca

Browse files
authored
Assert version is read successfully from LevelDB (#3362)
This is just to make the failure more obvious (otherwise, the call to `std::stoi` fails).
1 parent ec35576 commit 64f4dca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Firestore/core/src/firebase/firestore/local/leveldb_migrations.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ LevelDbMigrations::SchemaVersion LevelDbMigrations::ReadSchemaVersion(
316316
if (status.IsNotFound()) {
317317
return 0;
318318
} else {
319+
HARD_ASSERT(status.ok(),
320+
"Failed to read version string from LevelDB, error: '%s'",
321+
status.ToString());
319322
return stoi(version_string);
320323
}
321324
}

0 commit comments

Comments
 (0)