diff options
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r-- | tools/aapt2/ResourceParser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp index 084325a44d93..9a37913f0edc 100644 --- a/tools/aapt2/ResourceParser.cpp +++ b/tools/aapt2/ResourceParser.cpp @@ -623,6 +623,11 @@ 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>( |