From 1567a6e29d5ee5bc7b66baafcbf42d9cd9672cbc Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 19 Jan 2025 14:32:08 -0600 Subject: [PATCH] [applib] Fix build --- src/olympic/studio/applib/src/newmenu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/olympic/studio/applib/src/newmenu.cpp b/src/olympic/studio/applib/src/newmenu.cpp index 828de7c2..a0b5be55 100644 --- a/src/olympic/studio/applib/src/newmenu.cpp +++ b/src/olympic/studio/applib/src/newmenu.cpp @@ -165,13 +165,13 @@ void NewMenu::finish(StudioContext &sctx) noexcept { return; } auto const&im = *m_types[m_selectedType]; - if (sctx.project->exists(im.itemPath(m_itemName))) { + auto const path = m_path.len() ? + im.itemPath(m_itemName, m_path) : im.itemPath(m_itemName); + if (sctx.project->exists(path)) { oxLogError(ox::Error{1, "New file error: file already exists"}); return; } - auto const [path, err] = - im.write(sctx, m_itemName, m_selectedTemplate); - if (err) { + if (auto const err = im.write(sctx, path, m_selectedTemplate)) { oxLogError(err); return; }