Skip to content

Commit 3d0c95a

Browse files
committed
check whether prevOpts is nil in WipeoutBuildPathIfBuildOptionsChanged's Run
1 parent 6a177eb commit 3d0c95a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

legacy/builder/wipeout_build_path_if_build_options_changed.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(ctx *types.Context) error {
4545
json.Unmarshal([]byte(previousBuildOptionsJson), &prevOpts)
4646

4747
// If SketchLocation path is different but filename is the same, consider it equal
48-
if filepath.Base(opts.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
48+
if prevOpts != nil && filepath.Base(opts.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
4949
opts.Remove("sketchLocation")
5050
prevOpts.Remove("sketchLocation")
5151
}
5252

5353
// If options are not changed check if core has
54-
if opts.Equals(prevOpts) {
54+
if prevOpts != nil && opts.Equals(prevOpts) {
5555
// check if any of the files contained in the core folders has changed
5656
// since the json was generated - like platform.txt or similar
5757
// if so, trigger a "safety" wipe

0 commit comments

Comments
 (0)