Skip to content

Commit 5b111df

Browse files
Don't crash RTDB SDK if version file is empty (#5719)
1 parent 9645b2a commit 5b111df

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Firebase/Database/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v6.2.2
2+
- [fixed] Addressed crash that prevented the SDK from opening when the versioning file was
3+
corrupted. (#5686)
4+
15
# v6.2.1
26
- [fixed] Fixed documentation typos. (#5406, #5418)
37

Firebase/Database/Persistence/FLevelDBStorageEngine.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ - (void)runMigration {
132132
}
133133
} else if ([oldVersion isEqualToString:kFPersistenceVersion]) {
134134
// Everythings fine no need for migration
135+
} else if ([oldVersion length] == 0) {
136+
FFWarn(@"I-RDB076036",
137+
@"Version file empty. Assuming database version 1.");
135138
} else {
136139
// If we add more versions in the future, we need to run migration here
137140
[NSException raise:NSInternalInconsistencyException

0 commit comments

Comments
 (0)