From 745f4dd816aeea5a2a2ba5f8dbf8f80df3a46bdf Mon Sep 17 00:00:00 2001 From: Nan Xiao Date: Wed, 5 Apr 2017 17:56:17 +0800 Subject: [PATCH] Check NULL value of result. --- example/example.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example/example.cpp b/example/example.cpp index 62a5077..2b67c90 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -19,6 +19,10 @@ int main(int argc, char *argv[]) { hsql::SQLParserResult* result = hsql::SQLParser::parseSQLString(query); // check whether the parsing was successful + if (!result) { + return -1; + } + if (result->isValid()) { printf("Parsed successfully!\n"); printf("Number of statements: %lu\n", result->size());