mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	hugolib: Avoid nilpointer in absoluteSourceRef
This commit is contained in:
		@@ -1883,10 +1883,12 @@ func (p *Page) FullFilePath() string {
 | 
			
		||||
// For pages that do not (sections witout content page etc.), it returns the
 | 
			
		||||
// virtual path, consistent with where you would add a source file.
 | 
			
		||||
func (p *Page) absoluteSourceRef() string {
 | 
			
		||||
	if p.Source.File != nil {
 | 
			
		||||
		sourcePath := p.Source.Path()
 | 
			
		||||
		if sourcePath != "" {
 | 
			
		||||
			return "/" + filepath.ToSlash(sourcePath)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(p.sections) > 0 {
 | 
			
		||||
		// no backing file, return the virtual source path
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user