瀏覽代碼

check that the framer exists before trying to access the warnings

Vincent Rischmann 9 年之前
父節點
當前提交
b0b4cc30ef
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      session.go

+ 4 - 1
session.go

@@ -1238,7 +1238,10 @@ func (iter *Iter) GetCustomPayload() map[string][]byte {
 //
 // This is only available starting with CQL Protocol v4.
 func (iter *Iter) Warnings() []string {
-	return iter.framer.header.warnings
+	if iter.framer != nil {
+		return iter.framer.header.warnings
+	}
+	return nil
 }
 
 // Close closes the iterator and returns any errors that happened during