diff --git a/src/crwimage_int.cpp b/src/crwimage_int.cpp index fa104b9b47..f1e93e9298 100644 --- a/src/crwimage_int.cpp +++ b/src/crwimage_int.cpp @@ -555,8 +555,8 @@ CiffComponent* CiffDirectory::doAdd(CrwDirs& crwDirs, uint16_t crwTagId) { if (!cc) { // Directory doesn't exist yet, add it auto m = std::make_unique(dir.dir, dir.parent); - cc = m.get(); add(std::move(m)); + cc = components_.back(); } // Recursive call to next lower level directory return cc->add(crwDirs, crwTagId); @@ -571,8 +571,8 @@ CiffComponent* CiffDirectory::doAdd(CrwDirs& crwDirs, uint16_t crwTagId) { if (!cc) { // Tag doesn't exist yet, add it auto m = std::make_unique(crwTagId, tag()); - cc = m.get(); add(std::move(m)); + cc = components_.back(); } return cc; } // CiffDirectory::doAdd