fix nil pointer dereference

Signed-off-by: zlawrence <zak.lawrence@zalando.de>
This commit is contained in:
zlawrence 2022-12-21 13:41:40 +01:00
parent 070f9ab299
commit 680e0feea1
No known key found for this signature in database
GPG Key ID: 35E54C19196DDE3E

View File

@ -331,7 +331,7 @@ func calculateMetrics(spec v1.ScalingScheduleSpec, defaultScalingWindow time.Dur
}
// If no end time was provided, set it to equal the start time
if (string(*schedule.EndDate)) == "" {
if schedule.EndDate == nil || *schedule.EndDate == "" {
scheduledEndTime = scheduledTime
} else {
scheduledEndTime, err = time.Parse(time.RFC3339, string(*schedule.EndDate))