diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java b/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java
index <HASH>..<HASH> 100644
--- a/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java
+++ b/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java
@@ -21,6 +21,10 @@ public class WebsocketHandler {
 
     public void handleFrame(final ChannelHandlerContext ctx,
                             final WebSocketFrame message) {
+        if (this.websocketServer == null) {
+            return;
+        }
+
         Optional<WebSocketFrame> frame = getResponseFrame(ctx, message);
         frame.ifPresent(webSocketFrame -> ctx.channel().writeAndFlush(webSocketFrame));
     }
added guard for handle frame in websocket handler