mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Ensure that pusher is not nil preventing panic in push (#13945)
PR #13381 refactored notification actions to call NotifyCreateRef and NotifyDeleteRef in a slightly different manner. This leads to the pusher not being set before the call. This PR ensures that the pusher is updated before the call. Fix #13940 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -97,6 +97,12 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
 | 
			
		||||
		}
 | 
			
		||||
		var commits = &repo_module.PushCommits{}
 | 
			
		||||
		if opts.IsTag() { // If is tag reference {
 | 
			
		||||
			if pusher == nil || pusher.ID != opts.PusherID {
 | 
			
		||||
				var err error
 | 
			
		||||
				if pusher, err = models.GetUserByID(opts.PusherID); err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			tagName := opts.TagName()
 | 
			
		||||
			if opts.IsDelRef() {
 | 
			
		||||
				delTags = append(delTags, tagName)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user