File tree Expand file tree Collapse file tree 14 files changed +15
-0
lines changed
Expand file tree Collapse file tree 14 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
3636 try {
3737 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
3838 ws = wsc . WebSocket ;
39+ if ( ws is null ) return ;
3940 }
4041 catch ( WebSocketException ex ) {
4142 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
1616 try {
1717 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
1818 ws = wsc . WebSocket ;
19+ if ( ws is null ) return ;
1920 }
2021 catch ( WebSocketException ex ) {
2122 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
5858 try {
5959 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
6060 ws = wsc . WebSocket ;
61+ if ( ws is null ) return ;
6162 }
6263 catch ( WebSocketException ex ) {
6364 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
2828 try {
2929 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
3030 ws = wsc . WebSocket ;
31+ if ( ws is null ) return ;
3132 }
3233 catch ( WebSocketException ex ) {
3334 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
2626 try {
2727 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
2828 ws = wsc . WebSocket ;
29+ if ( ws is null ) return ;
2930 }
3031 catch ( WebSocketException ex ) {
3132 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
8686 try {
8787 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
8888 ws = wsc . WebSocket ;
89+ if ( ws is null ) return ;
8990 }
9091 catch ( WebSocketException ex ) {
9192 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
108108 try {
109109 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
110110 ws = wsc . WebSocket ;
111+ if ( ws is null ) return ;
111112 }
112113 catch ( WebSocketException ex ) {
113114 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
106106 try {
107107 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
108108 ws = wsc . WebSocket ;
109+ if ( ws is null ) return ;
109110 }
110111 catch ( WebSocketException ex ) {
111112 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public static async void UserStats(HttpListenerContext ctx) {
4040 try {
4141 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
4242 ws = wsc . WebSocket ;
43+ if ( ws is null ) return ;
4344 }
4445 catch ( WebSocketException ex ) {
4546 ctx . Response . Close ( ) ;
@@ -100,6 +101,7 @@ public static async void DeviceStats(HttpListenerContext ctx) {
100101 try {
101102 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
102103 ws = wsc . WebSocket ;
104+ if ( ws is null ) return ;
103105 }
104106 catch ( WebSocketException ex ) {
105107 ctx . Response . Close ( ) ;
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
7676 try {
7777 WebSocketContext wsc = await ctx . AcceptWebSocketAsync ( null ) ;
7878 ws = wsc . WebSocket ;
79+ if ( ws is null ) return ;
7980 }
8081 catch ( WebSocketException ex ) {
8182 ctx . Response . Close ( ) ;
You can’t perform that action at this time.
0 commit comments