diff --git a/cmd/config_import.go b/cmd/config_import.go index 4de34c9b..9a838721 100644 --- a/cmd/config_import.go +++ b/cmd/config_import.go @@ -53,6 +53,10 @@ The path must be for a json or yaml file.`, return err } + if file.Settings == nil || file.Server == nil { + return errors.New("invalid configuration file: 'settings' or 'server' fields are missing. Please ensure you are importing a file generated by the 'config export' command") + } + file.Settings.Key = key err = st.Settings.Save(file.Settings) if err != nil {