mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 10:44:12 +01:00 
			
		
		
		
	Validate Issue Index before querying DB (#16406)
This commit is contained in:
		
							parent
							
								
									18c18bb196
								
							
						
					
					
						commit
						fb04cc7dbd
					
				@ -1018,6 +1018,9 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// GetIssueByIndex returns raw issue without loading attributes by index in a repository.
 | 
					// GetIssueByIndex returns raw issue without loading attributes by index in a repository.
 | 
				
			||||||
func GetIssueByIndex(repoID, index int64) (*Issue, error) {
 | 
					func GetIssueByIndex(repoID, index int64) (*Issue, error) {
 | 
				
			||||||
 | 
						if index < 1 {
 | 
				
			||||||
 | 
							return nil, ErrIssueNotExist{}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	issue := &Issue{
 | 
						issue := &Issue{
 | 
				
			||||||
		RepoID: repoID,
 | 
							RepoID: repoID,
 | 
				
			||||||
		Index:  index,
 | 
							Index:  index,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user