Skip to content

Commit

Permalink
Test for 'nil' on GetRequiredConversationResolution() to avoid crash. (
Browse files Browse the repository at this point in the history
  • Loading branch information
reptile-deer-66 authored Jan 21, 2022
1 parent 2aa51d4 commit 603d6bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion github/resource_github_branch_protection_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func resourceGithubBranchProtectionV3Read(d *schema.ResourceData, meta interface
d.Set("repository", repoName)
d.Set("branch", branch)
d.Set("enforce_admins", githubProtection.GetEnforceAdmins().Enabled)
d.Set("require_conversation_resolution", githubProtection.GetRequiredConversationResolution().Enabled)
if rcr := githubProtection.GetRequiredConversationResolution(); rcr != nil {
d.Set("require_conversation_resolution", rcr.Enabled)
}

if err := flattenAndSetRequiredStatusChecks(d, githubProtection); err != nil {
return fmt.Errorf("Error setting required_status_checks: %v", err)
Expand Down

0 comments on commit 603d6bb

Please sign in to comment.