Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebce4ce

Browse files
authored
fix: check if owner groups exist before marshaling (#205)
1 parent176fb6a commitebce4ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎provider/workspace.go‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ func workspaceDataSource() *schema.Resource {
3939

4040
ownerGroupsText:=os.Getenv("CODER_WORKSPACE_OWNER_GROUPS")
4141
varownerGroups []string
42-
err:=json.Unmarshal([]byte(ownerGroupsText),&ownerGroups)
43-
iferr!=nil {
44-
returndiag.Errorf("couldn't parse owner groups %q",ownerGroupsText)
42+
ifownerGroupsText!="" {
43+
err:=json.Unmarshal([]byte(ownerGroupsText),&ownerGroups)
44+
iferr!=nil {
45+
returndiag.Errorf("couldn't parse owner groups %q",ownerGroupsText)
46+
}
4547
}
4648
_=rd.Set("owner_groups",ownerGroups)
4749

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp