From 842ff4d874da28bfa77a51093552c6fb761ffb06 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 15 May 2015 00:23:31 +0200 Subject: [PATCH] Catch exception for not found videos --- apps/openmw/mwgui/videowidget.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/videowidget.cpp b/apps/openmw/mwgui/videowidget.cpp index 2c9b1c97e..d28ea0b66 100644 --- a/apps/openmw/mwgui/videowidget.cpp +++ b/apps/openmw/mwgui/videowidget.cpp @@ -30,7 +30,18 @@ void VideoWidget::playVideo(const std::string &video) { mPlayer->setAudioFactory(new MWSound::MovieAudioFactory()); - mPlayer->playVideo(mVFS->get(video), video); + Files::IStreamPtr videoStream; + try + { + videoStream = mVFS->get(video); + } + catch (std::exception& e) + { + std::cerr << "Failed to open video: " << e.what() << std::endl; + return; + } + + mPlayer->playVideo(videoStream, video); osg::ref_ptr texture = mPlayer->getVideoTexture(); if (!texture)