From 001edcd71b3cd0a7ffe9acffaf2f2e4728d51ab5 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 11 Jan 2018 08:06:52 -0800 Subject: [PATCH] Allow creation of empty files with storage API --- libraries/shared/src/shared/Storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/shared/Storage.cpp b/libraries/shared/src/shared/Storage.cpp index b98df8406e..683903a4e8 100644 --- a/libraries/shared/src/shared/Storage.cpp +++ b/libraries/shared/src/shared/Storage.cpp @@ -55,7 +55,7 @@ StoragePointer FileStorage::create(const QString& filename, size_t size, const u if (!file.resize(size)) { throw std::runtime_error("Unable to resize file"); } - { + if (data) { auto mapped = file.map(0, size); if (!mapped) { throw std::runtime_error("Unable to map file");