aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/server/VaadinService.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java
index 18dc468cb0..cfbf2606ae 100644
--- a/server/src/com/vaadin/server/VaadinService.java
+++ b/server/src/com/vaadin/server/VaadinService.java
@@ -905,7 +905,7 @@ public abstract class VaadinService implements Serializable {
*
* @param request
* the request for which a UI is desired
- * @return the UI belonging to the request
+ * @return the UI belonging to the request or null if no UI is found
*
*/
public UI findUI(VaadinRequest request) {
@@ -915,9 +915,11 @@ public abstract class VaadinService implements Serializable {
// Get UI id from the request
String uiIdString = request.getParameter(UIConstants.UI_ID_PARAMETER);
- int uiId = Integer.parseInt(uiIdString);
-
- UI ui = session.getUIById(uiId);
+ UI ui = null;
+ if (uiIdString != null) {
+ int uiId = Integer.parseInt(uiIdString);
+ ui = session.getUIById(uiId);
+ }
UI.setCurrent(ui);
return ui;