diff --git a/internal/agent/TUIcustomizationPage.go b/internal/agent/TUIcustomizationPage.go index a172112..b7325e9 100644 --- a/internal/agent/TUIcustomizationPage.go +++ b/internal/agent/TUIcustomizationPage.go @@ -35,8 +35,10 @@ func runCustomizationPlugins() ([]YAMLPrompt, error) { var r []YAMLPrompt bus.Manager.Response(sdk.EventInteractiveInstall, func(p *pluggable.Plugin, resp *pluggable.EventResponse) { - err := json.Unmarshal([]byte(resp.Data), &r) - if err != nil { + if resp.Data == "" { + return + } + if err := json.Unmarshal([]byte(resp.Data), &r); err != nil { fmt.Println(err) } }) diff --git a/internal/agent/install.go b/internal/agent/install.go index 798a1a0..d5390b2 100644 --- a/internal/agent/install.go +++ b/internal/agent/install.go @@ -96,6 +96,9 @@ func Install(sourceImgURL string, dir ...string) error { }) bus.Manager.Response(events.EventInstall, func(p *pluggable.Plugin, resp *pluggable.EventResponse) { + if resp.Data == "" { + return + } err := json.Unmarshal([]byte(resp.Data), &r) if err != nil { fmt.Println(err) diff --git a/internal/agent/reset.go b/internal/agent/reset.go index 709f762..d1ea192 100644 --- a/internal/agent/reset.go +++ b/internal/agent/reset.go @@ -139,6 +139,9 @@ func sharedReset(reboot, unattended, resetOem bool, dir ...string) (c *config.Co // This gets the options from an event that can be sent by anyone. // This should override the default config as it's much more dynamic bus.Manager.Response(sdk.EventBeforeReset, func(p *pluggable.Plugin, r *pluggable.EventResponse) { + if r.Data == "" { + return + } err := json.Unmarshal([]byte(r.Data), &optionsFromEvent) if err != nil { fmt.Println(err)