Skip to content

Commit

Permalink
Fix channel optional name causing null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
davidweterings committed Apr 22, 2020
1 parent 3a0c925 commit 5e73720
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.21.1 (2020-04-22)
===================
- Fix channel read null pointer exception. Name should be optional.

0.21.0 (2020-02-27)
===================
- Provider arguments (`client_id`, `client_secret`, `project_key`,
Expand Down
5 changes: 4 additions & 1 deletion commercetools/resource_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ func resourceChannelRead(d *schema.ResourceData, m interface{}) error {

d.SetId(channel.ID)
d.Set("version", channel.Version)
d.Set("name", *channel.Name)

if channel.Name != nil {
d.Set("name", *channel.Name)
}
if channel.Description != nil {
d.Set("description", *channel.Description)
}
Expand Down

0 comments on commit 5e73720

Please sign in to comment.