mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 11:55:43 +00:00
Fixed crashes with not initialized CustomData
This commit is contained in:
@@ -28,6 +28,9 @@ public:
|
||||
*/
|
||||
template<class T> T* Get(std::string const & k) const {
|
||||
static_assert(std::is_base_of<Base, T>::value, "T must derive from Base");
|
||||
if (Container.empty())
|
||||
return nullptr;
|
||||
|
||||
auto it = Container.find(k);
|
||||
if (it != Container.end())
|
||||
return dynamic_cast<T*>(it->second.get());
|
||||
|
||||
Reference in New Issue
Block a user