]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
cli issue fix
authorKapil Gupta <kgupta@sangoma.com>
Tue, 7 Aug 2012 10:30:05 +0000 (06:30 -0400)
committerKapil Gupta <kgupta@sangoma.com>
Tue, 7 Aug 2012 10:30:05 +0000 (06:30 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway_cli.c

index 4fe1876277e3f4004340c62baff6477056f19f59..e131747f5b237c92f2ea8e9b17904f2ba7c2b494 100644 (file)
@@ -196,10 +196,12 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
                                goto usage;
                        }
 
-                       megaco_profile_release(profile);
-                       handle_term_status_cli_cmd(stream, profile, argv[3]);
-
-
+                       if(profile){
+                               megaco_profile_release(profile);
+                               handle_term_status_cli_cmd(stream, profile, argv[3]);
+                       } else {
+                               stream->write_function(stream, "-ERR No such profile\n");
+                       }
 
 /**********************************************************************************/
                }else {
@@ -237,6 +239,7 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
 usage:
     if(profile)
         megaco_profile_release(profile);
+
        megaco_cli_print_usage(stream);
 
 done: