diff --git a/include/etl/optional.h b/include/etl/optional.h index d85763d25..8eefd5881 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -783,7 +783,11 @@ namespace etl { if (this != &other) { - storage.value = etl::move(other.storage.value); + if (other.has_value()) + { + storage.value = etl::move(other.storage.value); + } + valid = other.valid; }