diff options
author | Alan Pearce | 2024-04-21 22:31:56 +0200 |
---|---|---|
committer | Alan Pearce | 2024-04-21 22:31:56 +0200 |
commit | 3e8e5885a266e7a249855c17e35aa16f7cf011a9 (patch) | |
tree | 241df5974d4d4040cf6ea153da3e20fc42c0cc4c /cmd/build | |
parent | ffff4d09ab38e2ef3b56ee282f3cec5a558d5cc3 (diff) | |
download | website-3e8e5885a266e7a249855c17e35aa16f7cf011a9.tar.lz website-3e8e5885a266e7a249855c17e35aa16f7cf011a9.tar.zst website-3e8e5885a266e7a249855c17e35aa16f7cf011a9.zip |
check for nil before overriding BASE_URL
Diffstat (limited to 'cmd/build')
-rw-r--r-- | cmd/build/build.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/build/build.go b/cmd/build/build.go index 326b964..f165361 100644 --- a/cmd/build/build.go +++ b/cmd/build/build.go @@ -566,9 +566,11 @@ func main() { log.Panic(errors.Errorf("could not get config: %v", err)) } - config.BaseURL.URL, err = url.Parse(ioConfig.BaseURL.String()) - if err != nil { - log.Panic(errors.Errorf("highly unlikely: %v", err)) + if ioConfig.BaseURL.URL != nil { + config.BaseURL.URL, err = url.Parse(ioConfig.BaseURL.String()) + if err != nil { + log.Panic(errors.Errorf("highly unlikely: %v", err)) + } } err = os.RemoveAll(ioConfig.Destination) |