diff options
author | Denis Anisimov <denis@vaadin.com> | 2014-09-16 20:16:59 +0300 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2014-10-09 13:30:44 +0000 |
commit | 3f728bea50824b14a3cd5eaa05a7df99e9cd3dda (patch) | |
tree | e7135029637d385c3dc0bb5a405b449509cd4680 /server/src/com/vaadin/ui | |
parent | 709f35aca0f445444c8052015e34113e567a3166 (diff) | |
download | vaadin-framework-3f728bea50824b14a3cd5eaa05a7df99e9cd3dda.tar.gz vaadin-framework-3f728bea50824b14a3cd5eaa05a7df99e9cd3dda.zip |
Call endUpload() in finally block of fail handling (#14677).
Change-Id: I0b5976abf0d8804e8cd34c5dd489da8617ef89f1
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r-- | server/src/com/vaadin/ui/Upload.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/server/src/com/vaadin/ui/Upload.java b/server/src/com/vaadin/ui/Upload.java index 1c953779e4..693bd74dbf 100644 --- a/server/src/com/vaadin/ui/Upload.java +++ b/server/src/com/vaadin/ui/Upload.java @@ -1150,23 +1150,25 @@ public class Upload extends AbstractComponent implements Component.Focusable, fireUploadSuccess(event.getFileName(), event.getMimeType(), event.getContentLength()); endUpload(); - markAsDirty(); } @Override public void streamingFailed(StreamingErrorEvent event) { - Exception exception = event.getException(); - if (exception instanceof NoInputStreamException) { - fireNoInputStream(event.getFileName(), - event.getMimeType(), 0); - } else if (exception instanceof NoOutputStreamException) { - fireNoOutputStream(event.getFileName(), - event.getMimeType(), 0); - } else { - fireUploadInterrupted(event.getFileName(), - event.getMimeType(), 0, exception); + try { + Exception exception = event.getException(); + if (exception instanceof NoInputStreamException) { + fireNoInputStream(event.getFileName(), + event.getMimeType(), 0); + } else if (exception instanceof NoOutputStreamException) { + fireNoOutputStream(event.getFileName(), + event.getMimeType(), 0); + } else { + fireUploadInterrupted(event.getFileName(), + event.getMimeType(), 0, exception); + } + } finally { + endUpload(); } - endUpload(); } }; } |