From dfe573c66ebdcf8fb43b9c037b5609bcb8c90213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 4 Oct 2018 11:38:27 +0200 Subject: [PATCH] [ion/storage] Handle nullptr name when looking for a record --- ion/src/shared/storage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ion/src/shared/storage.cpp b/ion/src/shared/storage.cpp index c365898df..046a97f05 100644 --- a/ion/src/shared/storage.cpp +++ b/ion/src/shared/storage.cpp @@ -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) {