aboutsummaryrefslogtreecommitdiff
path: root/cmd/root.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/root.go')
-rw-r--r--cmd/root.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/root.go b/cmd/root.go
index 33b0116..d00ea2a 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -151,11 +151,15 @@ Authors: FalconOps LLC (@FalconOpsLLC),
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
- if err := logFile.Close(); err != nil {
- // ...
+ if logFile != nil {
+ if err := logFile.Close(); err != nil {
+ // ...
+ }
}
- if err := exec.Input.StageFile.Close(); err != nil {
- // ...
+ if exec.Input != nil && exec.Input.StageFile != nil {
+ if err := exec.Input.StageFile.Close(); err != nil {
+ // ...
+ }
}
},
}