Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

Commit f2512aa

Browse files
committed
Fixed NPE in ServletViewEngine on Liberty (#200)
1 parent fc4ef5b commit f2512aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/org/mvcspec/ozark/engine/ServletViewEngine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ protected void forwardRequest(ViewEngineContext context, String... extensions)
7474
// Find request dispatcher based on extensions
7575
for (Map.Entry<String, ? extends ServletRegistration> e : servletContext.getServletRegistrations().entrySet()) {
7676
final Collection<String> mappings = e.getValue().getMappings();
77-
if (mappings.containsAll(Arrays.asList(extensions))) {
77+
// the 'mappings' collection may be null on Liberty (see #200)
78+
if (mappings != null && mappings.containsAll(Arrays.asList(extensions))) {
7879
rd = servletContext.getNamedDispatcher(e.getKey()); // by servlet name
7980

8081
// Need new request with updated URI and extension matching semantics

0 commit comments

Comments
 (0)