summaryrefslogtreecommitdiff
path: root/gtk2_ardour/template_dialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/template_dialog.cc')
-rw-r--r--gtk2_ardour/template_dialog.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/template_dialog.cc b/gtk2_ardour/template_dialog.cc
index 4b2813b7d5..c437c246aa 100644
--- a/gtk2_ardour/template_dialog.cc
+++ b/gtk2_ardour/template_dialog.cc
@@ -568,9 +568,11 @@ RouteTemplateManager::rename_template (TreeModel::iterator& item, const Glib::us
const string new_state_dir = Glib::build_filename (user_route_template_directory(), new_name);
if (adjusted) {
- if (g_rename (old_state_dir.c_str(), new_state_dir.c_str()) != 0) {
- error << string_compose (_("Could not rename state dir \"%1\" to \"%22\": %3"), old_state_dir, new_state_dir, strerror (errno)) << endmsg;
- return;
+ if (g_file_test (old_state_dir.c_str(), G_FILE_TEST_EXISTS)) {
+ if (g_rename (old_state_dir.c_str(), new_state_dir.c_str()) != 0) {
+ error << string_compose (_("Could not rename state dir \"%1\" to \"%22\": %3"), old_state_dir, new_state_dir, strerror (errno)) << endmsg;
+ return;
+ }
}
}