mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 15:00:21 +08:00
Bugfix: Fix potential nil dereference
This commit is contained in:
parent
ff8e701793
commit
613a9e3143
@ -426,7 +426,9 @@ func FindPathToFile(fsys fs.FS, file string) (string, error) {
|
|||||||
path, _ := filepath.Split(selected)
|
path, _ := filepath.Split(selected)
|
||||||
return path, nil
|
return path, nil
|
||||||
}
|
}
|
||||||
|
if indexFiles.Length() > 0 {
|
||||||
path, _ := filepath.Split(indexFiles.AsSlice()[0])
|
path, _ := filepath.Split(indexFiles.AsSlice()[0])
|
||||||
return path, nil
|
return path, nil
|
||||||
|
}
|
||||||
|
return "", fmt.Errorf("no index.html found")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user