From df24434f71376caa4d973345694cb8aee30255bf Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 4 Jun 2012 05:13:14 -0700 Subject: [PATCH] Do not assert if the tab completer is given garbage. --- Console.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.45.2