fix nil ptr
This commit is contained in:
		
							
								
								
									
										2
									
								
								http.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								http.go
									
									
									
									
									
								
							| @@ -562,6 +562,8 @@ func (h *Server) Start() error { | |||||||
| 		var ok bool | 		var ok bool | ||||||
| 		if hs, ok = h.opts.Context.Value(serverKey{}).(*http.Server); ok && hs != nil { | 		if hs, ok = h.opts.Context.Value(serverKey{}).(*http.Server); ok && hs != nil { | ||||||
| 			hs.Handler = fn | 			hs.Handler = fn | ||||||
|  | 		} else { | ||||||
|  | 			hs = &http.Server{Handler: fn} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user