From f511367b330b856bc63995205f053e990fc16c74 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sat, 20 Sep 2014 19:57:03 +0200 Subject: [PATCH] BSoftSynth::SetInstrumentsFile(): Check if file exists. --- src/kits/midi/SoftSynth.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/midi/SoftSynth.cpp b/src/kits/midi/SoftSynth.cpp index 84af47497f..7ff6e9b28a 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; }