mirror of https://github.com/qwc/backive.git
Create map if it does not exist
This commit is contained in:
parent
fe83c16934
commit
87109b6bf0
|
@ -159,6 +159,9 @@ func (r *Runs) Load(db Database) {
|
||||||
|
|
||||||
// Save saves the data into the json database
|
// Save saves the data into the json database
|
||||||
func (r *Runs) Save(db Database) {
|
func (r *Runs) Save(db Database) {
|
||||||
|
if db.data == nil {
|
||||||
|
db.data = map[string]string{}
|
||||||
|
}
|
||||||
str, err := json.Marshal(r.data)
|
str, err := json.Marshal(r.data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue