summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtzukanov <mtzukanov@vaadin.com>2013-06-28 15:52:48 +0300
committerVaadin Code Review <review@vaadin.com>2013-06-28 13:09:35 +0000
commitda480bdce215249344a9c80bb257a4575f072ceb (patch)
tree09ae8b5c2b07252524379d1c2bce66d580a79184
parent08d365a41885c62597b9f0d29d6ef59b45b36577 (diff)
downloadvaadin-framework-da480bdce215249344a9c80bb257a4575f072ceb.tar.gz
vaadin-framework-da480bdce215249344a9c80bb257a4575f072ceb.zip
Fix VaadinService.findUI to throw Error if UIConstants.UI_ID_PARAMETER
is not set (#11943) Change-Id: I3cbb88e3fab4f39af8e4799d5a914ab9bd4733f5
-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;