about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-04-21 22:31:56 +0200
committerAlan Pearce2024-04-21 22:31:56 +0200
commit3e8e5885a266e7a249855c17e35aa16f7cf011a9 (patch)
tree241df5974d4d4040cf6ea153da3e20fc42c0cc4c
parentffff4d09ab38e2ef3b56ee282f3cec5a558d5cc3 (diff)
downloadwebsite-3e8e5885a266e7a249855c17e35aa16f7cf011a9.tar.lz
website-3e8e5885a266e7a249855c17e35aa16f7cf011a9.tar.zst
website-3e8e5885a266e7a249855c17e35aa16f7cf011a9.zip
check for nil before overriding BASE_URL
-rw-r--r--cmd/build/build.go8
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)