diff options
author | Matt Joiner <anacrolix@gmail.com> | 2019-10-25 11:50:54 +1100 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2019-10-25 11:50:54 +1100 |
commit | 7b273432145605d367557e60ab51b9eb7dbbffeb (patch) | |
tree | d977c4edcb95c96c22be33c42dd6d5dd47f7bb12 | |
parent | Get rid of globalCond (diff) | |
download | stm-7b273432145605d367557e60ab51b9eb7dbbffeb.tar.gz stm-7b273432145605d367557e60ab51b9eb7dbbffeb.tar.xz |
Panic when trying to set a nil Var
This wasn't caught, and would cause errors later that weren't easy to trace.
-rw-r--r-- | tx.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -69,6 +69,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 } |