1
0
mirror of synced 2024-11-24 15:50:16 +01:00

patterns: Fixed crash when using attributes

This commit is contained in:
WerWolv 2022-03-03 11:19:46 +01:00
parent 39da62532b
commit 2880ca00da

View File

@ -44,8 +44,10 @@ namespace hex::pl {
Attributable(const Attributable &other) {
for (auto &attribute : other.m_attributes) {
auto copy = attribute->clone();
if (auto node = dynamic_cast<ASTNodeAttribute *>(copy.get()))
if (auto node = dynamic_cast<ASTNodeAttribute *>(copy.get())) {
this->m_attributes.push_back(std::unique_ptr<ASTNodeAttribute>(node));
(void)copy.release();
}
}
}