Skip to content

Commit

Permalink
Fix nilpointer in js.Build error handling
Browse files Browse the repository at this point in the history
Fixes #8162
  • Loading branch information
bep committed Jan 21, 2021
1 parent a1a9f08 commit a1fe552
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources/resource_transformers/js/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
package js

import (
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"regexp"
"strings"

"github.com/pkg/errors"

"github.com/spf13/afero"

"github.com/gohugoio/hugo/hugofs"
Expand Down Expand Up @@ -108,6 +109,9 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx

createErr := func(msg api.Message) error {
loc := msg.Location
if loc == nil {
return errors.New(msg.Text)
}
path := loc.File

var (
Expand Down

0 comments on commit a1fe552

Please sign in to comment.