Slightly refactor ImageResourceGenerator to avoid shadowing exception
The failed assertion in the finally block is hiding the actual exception,
so move it out of there so we can see the actual failure in the
community build server.
Change-Id: I3c03f8f054d725e4354201106973d56ad110f2bd
diff --git a/user/src/com/google/gwt/resources/rg/ImageResourceGenerator.java b/user/src/com/google/gwt/resources/rg/ImageResourceGenerator.java
index 7272265..f174e43 100644
--- a/user/src/com/google/gwt/resources/rg/ImageResourceGenerator.java
+++ b/user/src/com/google/gwt/resources/rg/ImageResourceGenerator.java
@@ -102,10 +102,12 @@
rect = e.getImageRect();
throw new CannotBundleImageException(localized, rect);
} finally {
- assert rect != null : "No ImageRect";
- rect.setHeight(image.getScaleHeight());
- rect.setWidth(image.getScaleWidth());
+ if (rect != null) {
+ rect.setHeight(image.getScaleHeight());
+ rect.setWidth(image.getScaleWidth());
+ }
}
+ assert rect != null : "No ImageRect";
return localized;
}