Browse Source

Fix VaadinService.findUI to throw Error if UIConstants.UI_ID_PARAMETER

is not set (#11943)

Change-Id: I3cbb88e3fab4f39af8e4799d5a914ab9bd4733f5
tags/7.1.1
mtzukanov 11 years ago
parent
commit
da480bdce2
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      server/src/com/vaadin/server/VaadinService.java

+ 6
- 4
server/src/com/vaadin/server/VaadinService.java View File

@@ -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;

Loading…
Cancel
Save