From 3e81bc68b704d270fbdf7767a8f99984d157033e Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Mon, 2 May 2022 09:53:24 +0200 Subject: [PATCH] Add comment and nil check (better save than sorry) --- mediaapi/routing/routing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index afe62766e..372605d5a 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -74,7 +74,8 @@ func Setup( return *r } respondSize := cfg.MaxFileSizeBytes - if *cfg.MaxFileSizeBytes == 0 { + // Shouldn't be nil, as this is checked at startup. + if cfg.MaxFileSizeBytes != nil && *cfg.MaxFileSizeBytes == 0 { respondSize = nil } return util.JSONResponse{