From: Carl Hetherington Date: Mon, 24 Dec 2018 23:55:29 +0000 (+0000) Subject: Fix failure to re-write bad configuration files caused by trying to check for a link... X-Git-Tag: v2.12.15~1 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=341f1d20aec99d6f413b66ce60824337fd1b36e3 Fix failure to re-write bad configuration files caused by trying to check for a link in the bad file. --- diff --git a/src/lib/config.cc b/src/lib/config.cc index e2f2bbeb9..dbd0aea71 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -970,10 +970,16 @@ Config::config_file () } /* See if there's a link */ - f.read_file (main); - optional link = f.optional_string_child("Link"); - if (link) { - return *link; + try { + f.read_file (main); + optional link = f.optional_string_child("Link"); + if (link) { + return *link; + } + } catch (xmlpp::exception& e) { + /* There as a problem reading the main configuration file, + so there can't be a link. + */ } return main;