Skip to content

Commit 2891998

Browse files
authored
Merge pull request #843 from armsnyder/841-user-panic
Fix gitlab_user datasource crash
2 parents 82a9a40 + 72ce212 commit 2891998

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 3.9.0 (2022-01-04)
1+
## 3.9.1 (Unreleased)
2+
3+
BUGFIXES:
4+
5+
* Fix crash in `gitlab_user` data source
6+
7+
## 3.9.0 (2022-02-04)
28

39
FEATURES:
410

gitlab/data_source_gitlab_user.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,13 @@ func dataSourceGitlabUserRead(ctx context.Context, d *schema.ResourceData, meta
231231
d.Set("state", user.State)
232232
d.Set("external", user.External)
233233
d.Set("extern_uid", user.ExternUID)
234-
d.Set("created_at", user.CreatedAt.String())
234+
235+
if user.CreatedAt != nil {
236+
d.Set("created_at", user.CreatedAt.String())
237+
} else {
238+
d.Set("created_at", "")
239+
}
240+
235241
d.Set("organization", user.Organization)
236242
d.Set("two_factor_enabled", user.TwoFactorEnabled)
237243
d.Set("note", user.Note)

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ go 1.16
55
require (
66
github.com/apparentlymart/go-cidr v1.1.0 // indirect
77
github.com/aws/aws-sdk-go v1.37.0 // indirect
8-
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
98
github.com/hashicorp/go-retryablehttp v0.7.0
109
github.com/hashicorp/hcl/v2 v2.8.2 // indirect
1110
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1

0 commit comments

Comments
 (0)