From: Jay Freeman (saurik) Date: Mon, 4 Jun 2012 12:13:14 +0000 (-0700) Subject: Do not assert if the tab completer is given garbage. X-Git-Tag: v0.9.456~42 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/df24434f71376caa4d973345694cb8aee30255bf Do not assert if the tab completer is given garbage. --- diff --git a/Console.cpp b/Console.cpp index b7a4533..c6e13cb 100644 --- a/Console.cpp +++ b/Console.cpp @@ -211,7 +211,7 @@ static CYExpression *ParseExpression(CYUTF8String code) { Setup(driver, parser); if (parser.parse() != 0 || !driver.errors_.empty()) - _assert(false); + return NULL; CYExpress *express(dynamic_cast(driver.program_->statements_)); _assert(express != NULL); @@ -297,6 +297,9 @@ static char **Complete(const char *word, int start, int end) { CYUTF8String json(Run(pool, client_, code)); CYExpression *result(ParseExpression(json)); + if (result == NULL) + return NULL; + CYArray *array(dynamic_cast(result)); if (array == NULL) {