CecTray: try/catch xml exceptions when reading the xml config. bugzid: 2082
[deb_libcec.git] / src / LibCecTray / controller / applications / internal / XBMCController.cs
index c2697885973735bc992989e25cc40cea5a8c09f5..6b961008986ed01cd26ae12f724eda227c62be1a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -44,8 +44,8 @@ namespace LibCECTray.controller.applications.@internal
 {
        internal class XBMCController : ApplicationController
        {
-    public XBMCController(CECSettings settings) :
-      base(settings,
+    public XBMCController(CECController controller) :
+      base(controller,
            Resources.application_xbmc,
            "XBMC",
            "XBMC.exe",
@@ -93,8 +93,13 @@ namespace LibCECTray.controller.applications.@internal
       if (File.Exists(filename))
       {
         XmlTextReader reader = new XmlTextReader(filename);
-        while (reader.Read())
+        while (true)
         {
+          try
+          {
+            if (!reader.Read())
+              break;
+          } catch (XmlException) {}
           gotConfig = true;
           switch (reader.NodeType)
           {