]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed a problem with example code in article "Letting The User Download A File" ...
authorMartín López <mlopez@flowingcode.com>
Fri, 8 May 2020 16:50:20 +0000 (13:50 -0300)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 16:50:20 +0000 (19:50 +0300)
Fixes #10580

documentation/articles/LettingTheUserDownloadAFile.asciidoc

index f977b07956380e94d6ff1274f4603ba2cc0032c5..1ede8bd5c09bedf505304b280523b8b92be67dfb 100644 (file)
@@ -104,8 +104,15 @@ public class OnDemandFileDownloader extends FileDownloader {
     return super.handleConnectorRequest(request, response, path);
   }
 
-  private StreamResource getResource () {
-    return (StreamResource) this.getResource("dl");
+  private StreamResource getResource() {
+    StreamResource result = null;
+    this.getSession().lock();
+    try {
+      result = (StreamResource) this.getResource("dl");
+    } finally {
+      this.getSession().unlock();
+    }
+    return result;
   }
 }
 ....