From dbb99ee550912aa8c577cf68f182af27918ffed3 Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Sat, 13 Oct 2018 08:42:05 +0100
Subject: [PATCH] XLIFF: fix null approved-attr handling

---
 src/Main/XLIFFParser.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Main/XLIFFParser.cxx b/src/Main/XLIFFParser.cxx
index 9e4ede4e8..4cbb1e49e 100644
--- a/src/Main/XLIFFParser.cxx
+++ b/src/Main/XLIFFParser.cxx
@@ -56,11 +56,11 @@ void XLIFFParser::startElement(const char *name, const XMLAttributes &atts)
 
         _source.clear();
         _target.clear();
-        std::string as = atts.getValue("approved");
-        if (as.empty()) {
+        const char* ac = atts.getValue("approved");
+        if (!ac || !strcmp(ac, "")) {
             _approved = false;
         } else {
-            _approved = simgear::strutils::to_bool(as);
+            _approved = simgear::strutils::to_bool(std::string{ac});
         }
     } else if (tag == "group") {
         _resource = atts.getValue("resname");