invalid memory address or nil pointer dereference

Created by: lucymh

GitLab Provider version

3.15.0

GitLab version

GitLab Enterprise Edition 15.1.0-pre

Terraform version

1.0.7

Relevant Terraform Configuration

No response

Relevant log output

Stack trace from the terraform-provider-gitlab_v3.15.0 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb8 pc=0xb6a0a5]

goroutine 5879 [running]:
github.com/gitlabhq/terraform-provider-gitlab/internal/provider.resourceGitlabServiceMicrosoftTeamsRead({0xee57a8, 0xc000471800}, 0xc000099580, {0xd2f5c0, 0xc0002d9000})
	github.com/gitlabhq/terraform-provider-gitlab/internal/provider/resource_gitlab_service_microsoft_teams.go:149 +0x2c5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0003a6620, {0xee57e0, 0xc00068cfc0}, 0xd, {0xd2f5c0, 0xc0002d9000})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:724 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0003a6620, {0xee57e0, 0xc00068cfc0}, 0xc00017c1a0, {0xd2f5c0, 0xc0002d9000})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:1015 +0x585
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00000d278, {0xee5738, 0xc0004eb280}, 0xc0004eb300)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/grpc_provider.go:613 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0000fa460, {0xee57e0, 0xc00068ca20}, 0xc0004710e0)
	github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:746 +0x48c
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xd5fbe0, 0xc0000fa460}, {0xee57e0, 0xc00068ca20}, 0xc000471080, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000ae8c0, {0xef3f60, 0xc000276b60}, 0xc000479200, 0xc000381fb0, 0x144f590, 0x0)
	google.golang.org/grpc@v1.45.0/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc0000ae8c0, {0xef3f60, 0xc000276b60}, 0xc000479200, 0x0)
	google.golang.org/grpc@v1.45.0/server.go:1619 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.45.0/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.45.0/server.go:919 +0x294

Error: The terraform-provider-gitlab_v3.15.0 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Description

We're using this provider as part of our gitlab project management. Recently we had to remove a few projects and relocate some others and import these changes into the state. We're now trying to update our config to match reality but when we try to apply it we get the attached error messages.