From c4766e261175662e6168d79bc6cba01d146cc212 Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Sat, 31 Dec 2022 10:54:26 -0600 Subject: [PATCH] fix: add missing nil check (#971) Co-authored-by: Andrey Nering --- CHANGELOG.md | 2 ++ taskfile/merge.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f599b09..302303d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Small bug fix: closing "Taskfile.yml" once we're done reading it ([#963](https://github.com/go-task/task/issues/963), [#964](https://github.com/go-task/task/pull/964) by @HeCorr). +- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file + ([#961](https://github.com/go-task/task/issues/961), [#971](https://github.com/go-task/task/pull/971) by @pd93). - Fixed a bug where watch intervals set in the Taskfile were not being respected ([#969](https://github.com/go-task/task/pull/969), [#970](https://github.com/go-task/task/pull/970) by @pd93) - Add `--json` flag (alias `-j`) with the intent to improve support for code editors and add room to other possible integrations. This is basic for now, diff --git a/taskfile/merge.go b/taskfile/merge.go index daef3263..acf56bcc 100644 --- a/taskfile/merge.go +++ b/taskfile/merge.go @@ -45,7 +45,7 @@ func Merge(t1, t2 *Taskfile, includedTaskfile *IncludedTaskfile, namespaces ...s // Set the task to internal if EITHER the included task or the included // taskfile are marked as internal - task.Internal = task.Internal || includedTaskfile.Internal + task.Internal = task.Internal || (includedTaskfile != nil && includedTaskfile.Internal) // Add namespaces to dependencies, commands and aliases for _, dep := range task.Deps {