mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 08:21:11 +00:00 
			
		
		
		
	Backport #21052 Before converting a TrackedTime for the API we need to load its attributes - otherwise we get an NPE. Fix #21041
This commit is contained in:
		
					parent
					
						
							
								ea38455e1f
							
						
					
				
			
			
				commit
				
					
						0ecbb71bee
					
				
			
		
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -101,6 +101,12 @@ func ToTimelineComment(c *issues_model.Comment, doer *user_model.User) *api.Time
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if c.Time != nil {
 | 
						if c.Time != nil {
 | 
				
			||||||
 | 
							err = c.Time.LoadAttributes()
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								log.Error("Time.LoadAttributes: %v", err)
 | 
				
			||||||
 | 
								return nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		comment.TrackedTime = ToTrackedTime(c.Time)
 | 
							comment.TrackedTime = ToTrackedTime(c.Time)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue