module: Fix ModSpecificData initialization

This commit is contained in:
fox.cpp 2023-02-05 22:25:34 +03:00
parent 0c534f5231
commit f16506ae1c
No known key found for this signature in database
GPG key ID: 5B991F6215D2FCC0

View file

@ -49,6 +49,9 @@ func (msd *ModSpecificData) Set(m Module, perInstance bool, value interface{}) {
key := msd.modKey(m, perInstance) key := msd.modKey(m, perInstance)
msd.modDataLck.Lock() msd.modDataLck.Lock()
defer msd.modDataLck.Unlock() defer msd.modDataLck.Unlock()
if msd.modData == nil {
msd.modData = make(map[string]interface{})
}
msd.modData[key] = value msd.modData[key] = value
} }