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