Skip to content

Commit 5bacc4f

Browse files
committed
fix: nil pointer
* fix nil pointer when setting an author icon URL Signed-off-by: Keith Russo <[email protected]>
1 parent cbad4f0 commit 5bacc4f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/channel_api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ func (a *Author) GetURL() string {
351351

352352
// SetIconURL - set the Author IconURL
353353
func (a *Author) SetIconURL(u *string) *Author {
354+
if u == nil {
355+
return a
356+
}
357+
354358
if _, err := url.Parse(*u); err != nil {
355359
return a
356360
}

0 commit comments

Comments
 (0)