From c35d1bd82ef8bc0fa3a8fcfac08f556ad092df3f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Mar 2023 17:44:06 +1100 Subject: [PATCH] StorageManager: fixed startup crash this crash was caused by AP_UAVCAN_DNA_Server declaring a storage object on the stack, which meant file was not initialised to nullptr. --- libraries/StorageManager/StorageManager.cpp | 3 +++ libraries/StorageManager/StorageManager.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/libraries/StorageManager/StorageManager.cpp b/libraries/StorageManager/StorageManager.cpp index 1811309488..c3bb826975 100644 --- a/libraries/StorageManager/StorageManager.cpp +++ b/libraries/StorageManager/StorageManager.cpp @@ -121,6 +121,9 @@ StorageAccess::StorageAccess(StorageManager::StorageType _type) : { // calculate available bytes total_size = 0; +#if AP_SDCARD_STORAGE_ENABLED + file = nullptr; +#endif for (uint8_t i=0; i