Skip to content

Commit 898859a

Browse files
committed
handle empty global settings
1 parent 096e236 commit 898859a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/plugin/config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package plugin
22

3-
import "fmt"
3+
import (
4+
"fmt"
5+
)
46

57
type GlobalSettings struct {
68
Radios []RadioSettings `json:"radios"`
@@ -13,6 +15,9 @@ type RadioSettings struct {
1315

1416
func parseGlobalSettings(settings map[string]any) (GlobalSettings, error) {
1517
result := GlobalSettings{}
18+
if len(settings) == 0 {
19+
return result, nil
20+
}
1621

1722
radios, ok := settings["radios"].([]any)
1823
if !ok {

pkg/plugin/plugin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func (p *Plugin) Start() {
3535
// p.deck.GetGlobalSettings blocks until p.deck.Start is called, which can only happen after p.Start was called -> we use a goroutine
3636
go func() {
3737
p.deck.GetGlobalSettings(p.uuid)
38-
log.Printf("global settings triggered\n")
3938
}()
4039
}
4140

0 commit comments

Comments
 (0)