From 3cb5a75e730c44025bb02d540ced8f66276a9b98 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Aug 2015 11:52:02 +0100 Subject: [PATCH] Don't crash on startup if the splash PNG can't be found. --- src/tools/dcpomatic.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 1ab316fec..e2465ea4a 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -798,13 +798,17 @@ private: wxInitAllImageHandlers (); wxSplashScreen* splash = 0; - if (!Config::have_existing ()) { - wxBitmap bitmap; - boost::filesystem::path p = shared_path () / "splash.png"; - if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) { - splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1); - wxYield (); + try { + if (!Config::have_existing ()) { + wxBitmap bitmap; + boost::filesystem::path p = shared_path () / "splash.png"; + if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) { + splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1); + wxYield (); + } } + } catch (boost::filesystem::filesystem_error& e) { + /* Maybe we couldn't find the splash image; never mind */ } SetAppName (_("DCP-o-matic")); -- 2.30.2