diff --git a/src/items/item.hpp b/src/items/item.hpp index c6b3f82413f..db7ea154d8c 100644 --- a/src/items/item.hpp +++ b/src/items/item.hpp @@ -35,7 +35,7 @@ class Item; class ItemProperties { public: template - const T &getAttribute(ItemAttribute_t type) const { + T getAttribute(ItemAttribute_t type) const { if constexpr (std::is_same_v) { return getString(type); } else { @@ -47,8 +47,7 @@ class ItemProperties { } g_logger().error("Failed to convert attribute for type {}", fmt::underlying(type)); - static T defaultType; - return defaultType; + return {}; } bool hasAttribute(ItemAttribute_t type) const {