Browse Source

Check for context type for nav() symbol

Serj Kalichev 1 year ago
parent
commit
2dfdb21fd4
1 changed files with 4 additions and 0 deletions
  1. 4 0
      plugins/klish/nav.c

+ 4 - 0
plugins/klish/nav.c

@@ -36,6 +36,10 @@ int klish_nav(kcontext_t *context)
 	const char *value = NULL;
 	const char *command_name = NULL;
 
+	// Navigation is suitable only for command actions but not for
+	// PTYPEs, CONDitions i.e. SERVICE_ACTIONS.
+	assert(kcontext_type(context) == KCONTEXT_ACTION);
+
 	parg = kcontext_candidate_parg(context);
 	entry = kparg_entry(parg);
 	value = kparg_value(parg);