mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-07-04 21:37:47 +02:00
fix(keys): validate keysPath non-empty in loadAndApplyKeys
Programmatic callers (or cobra MarkFlagRequired bypass) would
otherwise trigger os.Open("") with a confusing error message.
Matches existing profilePath / browserName validation style.
This commit is contained in:
@@ -122,6 +122,9 @@ func loadAndApplyKeys(browserName, profilePath, keysPath string) ([]browser.Brow
|
||||
if name == "" || name == "all" {
|
||||
return nil, fmt.Errorf(`requires -b <browser> (single, not "all")`)
|
||||
}
|
||||
if keysPath == "" {
|
||||
return nil, fmt.Errorf("requires -i <keys-file> (or - for stdin)")
|
||||
}
|
||||
|
||||
var r io.Reader = os.Stdin
|
||||
if keysPath != "-" {
|
||||
|
||||
Reference in New Issue
Block a user