From 4133db9f83b1c3deb5727ef7a2c6aa0d61107450 Mon Sep 17 00:00:00 2001 From: mfeemster Date: Thu, 25 Feb 2016 23:12:18 -0800 Subject: [PATCH] --Bug fixes -Gracefully recover from reading a bad palette file. --- Source/Ember/PaletteList.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Ember/PaletteList.h b/Source/Ember/PaletteList.h index 3796f07..702fb13 100644 --- a/Source/Ember/PaletteList.h +++ b/Source/Ember/PaletteList.h @@ -57,6 +57,13 @@ public: palettes.first->second.reserve(buf.size() / 2048);//Roughly what it takes per palette. ParsePalettes(rootNode, pfilename, palettes.first->second); xmlFreeDoc(doc); + + if (palettes.first->second.empty()) + { + added = false;//Reading failed, likely not a valid palette file. + s_Palettes.erase(filename); + AddToReport(string(loc) + " : Couldn't parse xml doc"); + } } else {