浏览代码

Merge pull request #880 from Zariel/framer/tracing

conn: dont try to trace if we dont have tracer
Chris Bannister 8 年之前
父节点
当前提交
0b715f1c56
共有 1 个文件被更改,包括 1 次插入1 次删除
  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
 	// TODO(zariel): tidy this up, simplify handling of frame parsing so its not duplicated
 	// everytime we need to parse a frame.
 	// everytime we need to parse a frame.
-	if len(framer.traceID) > 0 {
+	if len(framer.traceID) > 0 && tracer != nil {
 		tracer.Trace(framer.traceID)
 		tracer.Trace(framer.traceID)
 	}
 	}