summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-01-04 15:46:25 -0800
committerTor Norbye <tnorbye@google.com>2013-01-04 15:48:58 -0800
commit72c6137a7aa5e5ada6a4aeca52f33d060742beb6 (patch)
treea590aabb109f56de4a4e28d0ba80b7be82ff9e90 /tools/layoutlib
parent48f7cfb10622f8675741f36bdf5b1f679e3fe37c (diff)
downloadframeworks_base-72c6137a7aa5e5ada6a4aeca52f33d060742beb6.zip
frameworks_base-72c6137a7aa5e5ada6a4aeca52f33d060742beb6.tar.gz
frameworks_base-72c6137a7aa5e5ada6a4aeca52f33d060742beb6.tar.bz2
Handle empty flag attributes, such as gravity=""
Without this, an empty string will be passed into XmlUtils.convertValueToInt, which throws an index out of range exception. Change-Id: Ibd1a140e207653b205852087f33ccb87fbbb9bbc
Diffstat (limited to 'tools/layoutlib')
-rw-r--r--tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
index ab5c4a6..446d139 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
@@ -218,7 +218,7 @@ public final class BridgeTypedArray extends TypedArray {
return defValue;
}
- if (s == null) {
+ if (s == null || s.length() == 0) {
return defValue;
}