mirror of
https://github.com/restic/restic.git
synced 2025-10-29 12:30:03 +00:00
fix panic in fs_reader
This commit is contained in:
@@ -29,6 +29,10 @@ type CommandReader struct {
|
||||
}
|
||||
|
||||
func NewCommandReader(ctx context.Context, args []string, logOutput io.Writer) (*CommandReader, error) {
|
||||
if len(args) == 0 {
|
||||
return nil, fmt.Errorf("no command was specified as argument")
|
||||
}
|
||||
|
||||
// Prepare command and stdout
|
||||
command := exec.CommandContext(ctx, args[0], args[1:]...)
|
||||
stdout, err := command.StdoutPipe()
|
||||
|
||||
Reference in New Issue
Block a user