aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/state.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-06-28 18:02:54 +0900
committerOphestra <cat@gensokyo.uk>2026-06-28 18:02:54 +0900
commitd1319a497cb26f1b360ab027d1f67db8f5e1c777 (patch)
tree44cb75e89468411a0f20ba29124762ac6007bbfa /internal/rosa/state.go
parentcf7c34555c8df07d9baf582c65a9e88d1605e075 (diff)
internal/rosa: handle nil source
Source is not always required. This improves flexibility. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/state.go')
-rw-r--r--internal/rosa/state.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go
index d455149c..6b914edc 100644
--- a/internal/rosa/state.go
+++ b/internal/rosa/state.go
@@ -1134,10 +1134,12 @@ func (ctx *evalContext) pf(
}
default:
- panic(azalea.TypeError{
- Concrete: reflect.TypeOf(sourceA),
- Asserted: reflect.TypeFor[pkg.Artifact](),
- })
+ if sourceA != nil {
+ panic(azalea.TypeError{
+ Concrete: reflect.TypeOf(sourceA),
+ Asserted: reflect.TypeFor[pkg.Artifact](),
+ })
+ }
}
v = cachedArtifact{&meta, ctx.t.NewPackage(