Procházet zdrojové kódy

conn: dont try to trace if we dont have tracer

Chris Bannister před 8 roky
rodič
revize
990865929b
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      conn.go

+ 1 - 1
conn.go

@@ -724,7 +724,7 @@ func (c *Conn) prepareStatement(ctx context.Context, stmt string, tracer Tracer)
 
 	// TODO(zariel): tidy this up, simplify handling of frame parsing so its not duplicated
 	// everytime we need to parse a frame.
-	if len(framer.traceID) > 0 {
+	if len(framer.traceID) > 0 && tracer != nil {
 		tracer.Trace(framer.traceID)
 	}