Skip to content

Commit

Permalink
Issue #7891 - Correct no-match NativeWebSocketConfiguration condition
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed May 4, 2022
1 parent 0cb102c commit 6c2968a
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -22,6 +22,7 @@
import javax.servlet.ServletContext;

import org.eclipse.jetty.http.pathmap.MappedResource;
import org.eclipse.jetty.http.pathmap.MatchedResource;
import org.eclipse.jetty.http.pathmap.PathMappings;
import org.eclipse.jetty.http.pathmap.PathSpec;
import org.eclipse.jetty.http.pathmap.RegexPathSpec;
Expand Down Expand Up @@ -82,7 +83,10 @@ public WebSocketServerFactory getFactory()
*/
public MappedResource<WebSocketCreator> getMatch(String target)
{
return this.mappings.getMatched(target).getMappedResource();
MatchedResource<WebSocketCreator> matched = this.mappings.getMatched(target);
if (matched == null)
return null;
return matched.getMappedResource();
}

/**
Expand Down

0 comments on commit 6c2968a

Please sign in to comment.