diff options
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r-- | tools/aapt2/ResourceParser.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp index 45cea8190844..859fe80c5ce7 100644 --- a/tools/aapt2/ResourceParser.cpp +++ b/tools/aapt2/ResourceParser.cpp @@ -769,16 +769,14 @@ std::unique_ptr<Item> ResourceParser::ParseXml(xml::XmlPullParser* parser, return std::move(string); } - // If the text is empty, and the value is not allowed to be a string, encode it as a @null. - if (util::TrimWhitespace(raw_value).empty()) { - return ResourceUtils::MakeNull(); - } - if (allow_raw_value) { // We can't parse this so return a RawString if we are allowed. return util::make_unique<RawString>( table_->string_pool.MakeRef(util::TrimWhitespace(raw_value), StringPool::Context(config_))); + } else if (util::TrimWhitespace(raw_value).empty()) { + // If the text is empty, and the value is not allowed to be a string, encode it as a @null. + return ResourceUtils::MakeNull(); } return {}; } |