hrev47890 adds 1 changeset to branch 'master' old head: c0622eb3d3c52702fea95b9545af0fad5b3a8728 new head: f511367b330b856bc63995205f053e990fc16c74 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=f511367+%5Ec0622eb ---------------------------------------------------------------------------- f511367: BSoftSynth::SetInstrumentsFile(): Check if file exists. [ Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev47890 Commit: f511367b330b856bc63995205f053e990fc16c74 URL: http://cgit.haiku-os.org/haiku/commit/?id=f511367 Author: Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx> Date: Sat Sep 20 17:57:03 2014 UTC ---------------------------------------------------------------------------- 1 file changed, 3 insertions(+), 1 deletion(-) src/kits/midi/SoftSynth.cpp | 4 +++- ---------------------------------------------------------------------------- diff --git a/src/kits/midi/SoftSynth.cpp b/src/kits/midi/SoftSynth.cpp index 84af474..7ff6e9b 100644 --- a/src/kits/midi/SoftSynth.cpp +++ b/src/kits/midi/SoftSynth.cpp @@ -124,10 +124,12 @@ BSoftSynth::SetInstrumentsFile(const char* path) if (path == NULL) return B_BAD_VALUE; + if (!BEntry(path).Exists()) + return B_FILE_NOT_FOUND; + if (IsLoaded()) Unload(); - // TODO: Check for file existence ? fInstrumentsFile = strdup(path); return B_OK; }