account for nil struct

This commit is contained in:
Niko Storni 2022-08-11 05:28:06 +02:00
parent d93f463386
commit 9d93799d86

View file

@ -107,7 +107,7 @@ func (v *YtdlVideo) GetUploadTime() time.Time {
mortyRelease, err := sdk.GetAPIsConfigs().GetReleasedDate(v.ID)
if err != nil {
logrus.Error(err)
} else if mortyRelease.ReleaseTime != "" {
} else if mortyRelease != nil {
mortyReleaseTimestamp, err = time.ParseInLocation(time.RFC3339, mortyRelease.ReleaseTime, time.UTC)
if err != nil {
logrus.Error(err)