Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-19 23:39:24 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-19 23:39:24 +0300
commit65e610e1617647a7dc6bb9f7794cfad068cb3615 (patch)
treeb2ea1f877e1b7e40176700eb164fe48e6deefdbb
parentb56d9a1294e692d096bff442e0b1fec61a8c2b0f (diff)
hugolib: Avoid nilpointer in absoluteSourceRef
-rw-r--r--hugolib/page.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/hugolib/page.go b/hugolib/page.go
index 838791ab8..f45257c9d 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -1883,9 +1883,11 @@ 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 {
- sourcePath := p.Source.Path()
- if sourcePath != "" {
- return "/" + filepath.ToSlash(sourcePath)
+ if p.Source.File != nil {
+ sourcePath := p.Source.Path()
+ if sourcePath != "" {
+ return "/" + filepath.ToSlash(sourcePath)
+ }
}
if len(p.sections) > 0 {