diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index dcd1261a06386e7bd5e6ed1395e125d4d1b3a555..ecd7d2d31ecf77a5c9e41b24c99b8e68dc7f880a 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -192,9 +192,15 @@ static int32_t shellRunSingleCommand(TAOS *con, char *command) { if (regex_match(command, "^[ \t]*source[\t ]+[^ ]+[ \t;]*$", REG_EXTENDED | REG_ICASE)) { /* If source file. */ char *c_ptr = strtok(command, " ;"); - assert(c_ptr != NULL); + if (c_ptr == NULL) { + shellRunCommandOnServer(con, command); + return 0; + } c_ptr = strtok(NULL, " ;"); - assert(c_ptr != NULL); + if (c_ptr == NULL) { + shellRunCommandOnServer(con, command); + return 0; + } source_file(con, c_ptr); return 0; }