summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 2bacbc96270..bf8666238bb 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -9268,11 +9268,10 @@ gf_cli_snapshot (call_frame_t *frame, xlator_t *this,
if (!frame || !this || !data)
goto out;
- if (frame->local) {
- local = frame->local;
- } else {
+ if (!frame->local)
goto out;
- }
+
+ local = frame->local;
options = data;
@@ -9329,7 +9328,7 @@ gf_cli_snapshot (call_frame_t *frame, xlator_t *this,
ret = 0;
out:
- if (ret && GF_SNAP_OPTION_TYPE_STATUS == type) {
+ if (ret && local && GF_SNAP_OPTION_TYPE_STATUS == type) {
tmp_ret = dict_get_str (local->dict, "op_err_str", &err_str);
if (err_str) {
cli_err ("Snapshot Status : failed: %s", err_str);