mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix Matrix and MSTeams nil dereference (#28089)
Fixes #28088 Fixes #28094 Added missing tests. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -303,6 +303,36 @@ func repositoryTestPayload() *api.RepositoryPayload {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func packageTestPayload() *api.PackagePayload {
 | 
			
		||||
	return &api.PackagePayload{
 | 
			
		||||
		Action: api.HookPackageCreated,
 | 
			
		||||
		Sender: &api.User{
 | 
			
		||||
			UserName:  "user1",
 | 
			
		||||
			AvatarURL: "http://localhost:3000/user1/avatar",
 | 
			
		||||
		},
 | 
			
		||||
		Repository: nil,
 | 
			
		||||
		Organization: &api.User{
 | 
			
		||||
			UserName:  "org1",
 | 
			
		||||
			AvatarURL: "http://localhost:3000/org1/avatar",
 | 
			
		||||
		},
 | 
			
		||||
		Package: &api.Package{
 | 
			
		||||
			Owner: &api.User{
 | 
			
		||||
				UserName:  "user1",
 | 
			
		||||
				AvatarURL: "http://localhost:3000/user1/avatar",
 | 
			
		||||
			},
 | 
			
		||||
			Repository: nil,
 | 
			
		||||
			Creator: &api.User{
 | 
			
		||||
				UserName:  "user1",
 | 
			
		||||
				AvatarURL: "http://localhost:3000/user1/avatar",
 | 
			
		||||
			},
 | 
			
		||||
			Type:    "container",
 | 
			
		||||
			Name:    "GiteaContainer",
 | 
			
		||||
			Version: "latest",
 | 
			
		||||
			HTMLURL: "http://localhost:3000/user1/-/packages/container/GiteaContainer/latest",
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestGetIssuesPayloadInfo(t *testing.T) {
 | 
			
		||||
	p := issueTestPayload()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user