From 5bbbe8ffc987cf4a6d66aab8c5b371892e5ffbcf Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 25 Oct 2019 11:50:54 +1100 Subject: Panic when trying to set a nil Var This wasn't caught, and would cause errors later that weren't easy to trace. (cherry picked from commit 7b273432145605d367557e60ab51b9eb7dbbffeb) --- tx.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tx.go') diff --git a/tx.go b/tx.go index 127480e..c2dcbdc 100644 --- a/tx.go +++ b/tx.go @@ -55,6 +55,9 @@ func (tx *Tx) Get(v *Var) interface{} { // Set sets the value of a Var for the lifetime of the transaction. func (tx *Tx) Set(v *Var, val interface{}) { + if v == nil { + panic("nil Var") + } tx.writes[v] = val } -- cgit v1.2.3