summaryrefslogtreecommitdiff
path: root/tools/aapt2
diff options
context:
space:
mode:
authorBernie Innocenti <codewiz@google.com>2020-12-19 15:31:52 +0900
committerBernie Innocenti <codewiz@google.com>2020-12-21 15:50:57 +0000
commit58cf8e3ffa23752f4e8e38cab4d89f9b44f9e57a (patch)
tree3cc4048865054e95a9bf72a5a50fe19c8e849c29 /tools/aapt2
parent96db3dad2a4a1c4f1622a2b268b347cda0e808db (diff)
Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests Exempt-From-Owner-Approval: mechanical mass refactoring Change-Id: I3117833c51cdb333cccdfd159d1582f2adef77db
Diffstat (limited to 'tools/aapt2')
-rw-r--r--tools/aapt2/util/Util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/aapt2/util/Util.cpp b/tools/aapt2/util/Util.cpp
index ef33c3463a81..793a2368526b 100644
--- a/tools/aapt2/util/Util.cpp
+++ b/tools/aapt2/util/Util.cpp
@@ -531,14 +531,14 @@ bool ExtractResFilePathParts(const StringPiece& path, StringPiece* out_prefix,
}
StringPiece16 GetString16(const android::ResStringPool& pool, size_t idx) {
- if (auto str = pool.stringAt(idx)) {
+ if (auto str = pool.stringAt(idx); str.ok()) {
return *str;
}
return StringPiece16();
}
std::string GetString(const android::ResStringPool& pool, size_t idx) {
- if (auto str = pool.string8At(idx)) {
+ if (auto str = pool.string8At(idx); str.ok()) {
return ModifiedUtf8ToUtf8(str->to_string());
}
return Utf16ToUtf8(GetString16(pool, idx));