server: fix nil pointer panic when running as subserver
When Pool is started as a subserver in LiT the gRPC server is never
initialized. When trying to stop Pool this would lead to a nil pointer
panic.
@@ -510,7 +510,11 @@ func (s *Server) Stop() error {
if err != nil {
shutdownErr = err
}
+
+ // The gRPC server might be nil if started as a subserver.
+ if s.grpcServer != nil {
s.grpcServer.GracefulStop()
+ }
if s.restCancel != nil {
s.restCancel()
