fix: avoid runtime error when list is empty
This commit is contained in:
parent
4ae5e6123d
commit
9d621404fd
@ -100,7 +100,8 @@ func (a AppFiles) GetServers() []string {
|
||||
|
||||
func LoadAppFiles(servers ...string) (AppFiles, error) {
|
||||
appFiles := make(AppFiles)
|
||||
if len(servers) == 1 && servers[0] == "" {
|
||||
if len(servers) == 1 {
|
||||
if servers[0] == "" {
|
||||
// Empty servers flag, one string will always be passed
|
||||
var err error
|
||||
servers, err = getAllFoldersInDirectory(ABRA_SERVER_FOLDER)
|
||||
@ -108,6 +109,7 @@ func LoadAppFiles(servers ...string) (AppFiles, error) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, server := range servers {
|
||||
serverDir := path.Join(ABRA_SERVER_FOLDER, server)
|
||||
files, err := getAllFilesInDirectory(serverDir)
|
||||
|
Loading…
Reference in New Issue
Block a user