diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-11-01 13:12:07 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-01 12:04:37 +0000 |
commit | dbf982bb3b3ddccba00fbc889a0130feac2a6d2d (patch) | |
tree | 7a573a3241058ee4114bd4d6b1677c9ed4b20560 /client | |
parent | 008b582c66166b1a2e7ada4510e3a3d8be433a10 (diff) | |
download | vaadin-framework-dbf982bb3b3ddccba00fbc889a0130feac2a6d2d.tar.gz vaadin-framework-dbf982bb3b3ddccba00fbc889a0130feac2a6d2d.zip |
Fix client-side NPE in Image without a source (#10101)
Change-Id: I7911dffd8700dc166f7b8669d291a0e34cb43daf
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/image/ImageConnector.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ui/image/ImageConnector.java b/client/src/com/vaadin/client/ui/image/ImageConnector.java index 22067b051e..17ce058c5d 100644 --- a/client/src/com/vaadin/client/ui/image/ImageConnector.java +++ b/client/src/com/vaadin/client/ui/image/ImageConnector.java @@ -48,9 +48,12 @@ public class ImageConnector extends AbstractComponentConnector { clickEventHandler.handleEventHandlerRegistration(); - getWidget().setUrl( - getResourceUrl(AbstractEmbeddedState.SOURCE_RESOURCE)); - getWidget().setAltText(getState().alternateText); + String url = getResourceUrl(AbstractEmbeddedState.SOURCE_RESOURCE); + getWidget().setUrl(url != null ? url : ""); + + String alt = getState().alternateText; + // Some browsers turn a null alt text into a literal "null" + getWidget().setAltText(alt != null ? alt : ""); } protected final ClickEventHandler clickEventHandler = new ClickEventHandler( |