Permalink
Browse files
Avoid potential NullPointerException when filter parameters aren't de…
- Loading branch information...
Showing
with
13 additions
and
4 deletions.
-
+13
−4
hazelcast-wm/src/main/java/com/hazelcast/web/WebFilter.java
|
@@ -129,14 +129,23 @@ private void initInstance() throws ServletException { |
|
|
if (properties == null) {
|
|
|
properties = new Properties();
|
|
|
}
|
|
|
- properties.setProperty(CONFIG_LOCATION, getParam(CONFIG_LOCATION));
|
|
|
- properties.setProperty(INSTANCE_NAME, getParam(INSTANCE_NAME));
|
|
|
- properties.setProperty(USE_CLIENT, getParam(USE_CLIENT));
|
|
|
- properties.setProperty(CLIENT_CONFIG_LOCATION, getParam(CLIENT_CONFIG_LOCATION));
|
|
|
+
|
|
|
+ setProperty(CONFIG_LOCATION);
|
|
|
+ setProperty(INSTANCE_NAME);
|
|
|
+ setProperty(USE_CLIENT);
|
|
|
+ setProperty(CLIENT_CONFIG_LOCATION);
|
|
|
|
|
|
hazelcastInstance = getInstance(properties);
|
|
|
}
|
|
|
|
|
|
+ private void setProperty(String propertyName) {
|
|
|
+ String value = getParam(propertyName);
|
|
|
+
|
|
|
+ if(value != null) {
|
|
|
+ properties.setProperty(propertyName, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void removeSessionLocally(String sessionId) {
|
|
|
HazelcastHttpSession hazelSession = mapSessions.remove(sessionId);
|
|
|
if (hazelSession != null) {
|
|
|
0 comments on commit
38230bc