From 63ac1b1464bf5adb2813a6a1b5cb1657ecdf2c53 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 20 Apr 2015 22:46:39 -0400 Subject: [PATCH] SMF::end_write() is a no-op if there is no _smf structure --- libs/evoral/src/SMF.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index c4e06823a9..b6ec8ecba7 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -400,6 +400,11 @@ void SMF::end_write(string const & path) THROW_FILE_ERROR { Glib::Threads::Mutex::Lock lm (_smf_lock); + + if (!_smf) { + return; + } + FILE* f = fopen (path.c_str(), "w+"); if (f == 0) { throw FileError (path);