Initialize freezerUpdates variable

This commit is contained in:
Austin Roberts 2021-10-18 15:10:13 -05:00
parent 625d2c0e98
commit 81f2c2023a

View File

@ -12,6 +12,7 @@ var (
) )
func PluginTrackUpdate(num uint64, kind string, value interface{}) { func PluginTrackUpdate(num uint64, kind string, value interface{}) {
if freezerUpdates == nil { freezerUpdates = make(map[uint64]map[string]interface{}) }
update, ok := freezerUpdates[num] update, ok := freezerUpdates[num]
if !ok { if !ok {
update = make(map[string]interface{}) update = make(map[string]interface{})
@ -34,6 +35,7 @@ func pluginCommitUpdate(num uint64) {
} }
func PluginCommitUpdate(pl *plugins.PluginLoader, num uint64) { func PluginCommitUpdate(pl *plugins.PluginLoader, num uint64) {
if freezerUpdates == nil { freezerUpdates = make(map[uint64]map[string]interface{}) }
defer func() { delete(freezerUpdates, num) }() defer func() { delete(freezerUpdates, num) }()
update, ok := freezerUpdates[num] update, ok := freezerUpdates[num]
if !ok { if !ok {