commit | 1867878cb925b05b42d03ab970ed31bb59cc1ffd | [log] [tgz] |
---|---|---|
author | Diego Perez <diegoperez@google.com> | Thu Sep 15 11:44:20 2016 +0100 |
committer | Diego Perez <diegoperez@google.com> | Thu Sep 15 12:01:33 2016 +0000 |
tree | 9ee5c088c634aa663bc64538db397c36193b394d | |
parent | ca8608aadd23a95835957c78bdf678de5402e2eb [diff] |
Handle the case where there is no clip defined Currently this generates a NPE. Bug: http://b.android.com/221956 Change-Id: I54e758ea001c3ed41d3d01a09d9ed66be45233cc
diff --git a/bridge/src/com/android/layoutlib/bridge/impl/GcSnapshot.java b/bridge/src/com/android/layoutlib/bridge/impl/GcSnapshot.java index a39eb4d..769ee33 100644 --- a/bridge/src/com/android/layoutlib/bridge/impl/GcSnapshot.java +++ b/bridge/src/com/android/layoutlib/bridge/impl/GcSnapshot.java
@@ -620,7 +620,8 @@ int y = 0; int width; int height; - Rectangle clipBounds = originalGraphics.getClipBounds(); + Rectangle clipBounds = originalGraphics.getClip() != null ? originalGraphics + .getClipBounds() : null; if (clipBounds != null) { if (clipBounds.width == 0 || clipBounds.height == 0) { // Clip is 0 so no need to paint anything.