mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
fix: Don't crash on invalid config import (#5640)
This commit is contained in:
parent
20bfd131c6
commit
79d1aa9229
1 changed files with 4 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue