From 2f6b73d46149d08478d220d38073d389a673151d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 17 Mar 2012 03:06:35 -0700 Subject: [PATCH] Prevent streamMusic from throwing an exception --- apps/openmw/mwsound/soundmanager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwsound/soundmanager.cpp b/apps/openmw/mwsound/soundmanager.cpp index 8b8ffcedc..b215fd7c5 100644 --- a/apps/openmw/mwsound/soundmanager.cpp +++ b/apps/openmw/mwsound/soundmanager.cpp @@ -165,7 +165,16 @@ namespace MWSound { std::string filePath = mMusicLibrary.locate(filename, mFSStrict, true).string(); if(!filePath.empty()) - streamMusicFull(filePath); + { + try + { + streamMusicFull(filePath); + } + catch(std::exception &e) + { + std::cout << "Music Error: " << e.what() << "\n"; + } + } } void SoundManager::startRandomTitle()