Skip to content

Commit 8a4ca60

Browse files
authored
Merge pull request #35 from justwatch/fix/nil-pointer
Prevent nil pointer dereference
2 parents 0d9eff7 + 4b69550 commit 8a4ca60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

marketing/v19/adcreative.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func (ac AdCreative) GetLinkCaption() string {
298298
return ""
299299
}
300300

301-
if ac.ObjectStorySpec.LinkData != nil {
301+
if ac.ObjectStorySpec.LinkData != nil && ac.ObjectStorySpec.LinkData.CallToAction != nil && ac.ObjectStorySpec.LinkData.CallToAction.Value != nil {
302302
return ac.ObjectStorySpec.LinkData.CallToAction.Value.LinkCaption
303303
} else if ac.ObjectStorySpec.VideoData != nil && ac.ObjectStorySpec.VideoData.CallToAction != nil && ac.ObjectStorySpec.VideoData.CallToAction.Value != nil {
304304
return ac.ObjectStorySpec.VideoData.CallToAction.Value.LinkCaption

0 commit comments

Comments
 (0)