aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/system/tmpfiles.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/system/tmpfiles.go b/internal/system/tmpfiles.go
index 5a2307f4..5130f2e5 100644
--- a/internal/system/tmpfiles.go
+++ b/internal/system/tmpfiles.go
@@ -2,6 +2,7 @@ package system
import (
"bytes"
+ "errors"
"fmt"
"io"
"os"
@@ -35,6 +36,11 @@ func (t *Tmpfile) Type() Enablement { return Process }
func (t *Tmpfile) apply(_ *I) error {
fmsg.Verbose("copying", t)
+ if t.payload == nil {
+ // this is a misuse of the API; do not return an error message
+ return errors.New("invalid payload")
+ }
+
if b, err := os.Stat(t.src); err != nil {
return fmsg.WrapErrorSuffix(err,
fmt.Sprintf("cannot stat %q:", t.src))