[ion/storage] Handle nullptr name when looking for a record

This commit is contained in:
Léa Saviot
2018-10-04 11:38:27 +02:00
committed by Émilie Feral
parent 5e860bc0f5
commit dfe573c66e

View File

@@ -156,6 +156,9 @@ Storage::Record Storage::recordWithExtensionAtIndex(const char * extension, int
}
Storage::Record Storage::recordNamed(const char * fullName) {
if (fullName == nullptr) {
return Record();
}
for (char * p : *this) {
const char * currentName = fullNameOfRecordStarting(p);
if (strcmp(currentName, fullName) == 0) {