summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-02-22 18:10:31 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-22 18:10:31 -0800
commit6e71ab488d573d647176f0a86a5d5e4d5440bc3b (patch)
tree54dbf9ad4a9f30556c3ee6db17b8982194053788
parent36a1dc9c75f7f0b6dfcc603f1b685ad0e96d6035 (diff)
parent05902aa39843613ea93dd0c1b41d561d4ea85ff9 (diff)
downloadpackages_apps_Browser-6e71ab488d573d647176f0a86a5d5e4d5440bc3b.zip
packages_apps_Browser-6e71ab488d573d647176f0a86a5d5e4d5440bc3b.tar.gz
packages_apps_Browser-6e71ab488d573d647176f0a86a5d5e4d5440bc3b.tar.bz2
Merge "fix NPE in drawClipped"
-rw-r--r--src/com/android/browser/TabBar.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java
index 9da1927..1d17cb3 100644
--- a/src/com/android/browser/TabBar.java
+++ b/src/com/android/browser/TabBar.java
@@ -475,12 +475,14 @@ public class TabBar extends LinearLayout
mInactiveShaderPaint.setShader(mInactiveShader);
}
}
-
- int state = canvas.save();
- getLocationInWindow(mWindowPos);
- Paint paint = mSelected ? mActiveShaderPaint : mInactiveShaderPaint;
- drawClipped(canvas, paint, mPath, mWindowPos[0]);
- canvas.restoreToCount(state);
+ // add some monkey protection
+ if ((mActiveShader != null) && (mInactiveShader != null)) {
+ int state = canvas.save();
+ getLocationInWindow(mWindowPos);
+ Paint paint = mSelected ? mActiveShaderPaint : mInactiveShaderPaint;
+ drawClipped(canvas, paint, mPath, mWindowPos[0]);
+ canvas.restoreToCount(state);
+ }
super.dispatchDraw(canvas);
}