5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 03:40:12 +08:00

Bugfix: Fix potential nil dereference

This commit is contained in:
Lea Anthony 2022-02-23 20:57:05 +11:00
parent ff8e701793
commit 613a9e3143

View File

@ -426,7 +426,9 @@ func FindPathToFile(fsys fs.FS, file string) (string, error) {
path, _ := filepath.Split(selected)
return path, nil
}
path, _ := filepath.Split(indexFiles.AsSlice()[0])
return path, nil
if indexFiles.Length() > 0 {
path, _ := filepath.Split(indexFiles.AsSlice()[0])
return path, nil
}
return "", fmt.Errorf("no index.html found")
}