[applib] Fix build

This commit is contained in:
Gary Talent 2025-01-19 14:32:08 -06:00
parent 89d543bcbc
commit 1567a6e29d

View File

@ -165,13 +165,13 @@ void NewMenu::finish(StudioContext &sctx) noexcept {
return; return;
} }
auto const&im = *m_types[m_selectedType]; 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"}); oxLogError(ox::Error{1, "New file error: file already exists"});
return; return;
} }
auto const [path, err] = if (auto const err = im.write(sctx, path, m_selectedTemplate)) {
im.write(sctx, m_itemName, m_selectedTemplate);
if (err) {
oxLogError(err); oxLogError(err);
return; return;
} }