1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

BUG: Ensure report location is not empty (#2560)

This commit is contained in:
imlonghao
2023-09-17 03:52:59 +08:00
committed by GitHub
parent c01fb2d40b
commit fa890063a1

View File

@ -293,7 +293,7 @@ func run(args PreviewArgs, push bool, interactive bool, out printer.CLI, report
if totalCorrections != 0 && args.WarnChanges {
return fmt.Errorf("there are pending changes")
}
if report != nil {
if report != nil && *report != "" {
f, err := os.OpenFile(*report, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
if err != nil {
return err