diff --git a/Makefile b/Makefile index 119925c..a9be9c3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Package configuration PROJECT = client-go -LIBUAST_VERSION ?= 2.0.0 +LIBUAST_VERSION ?= 2.0.1 TOOLS_FOLDER = tools @@ -65,4 +65,4 @@ unix-dependencies: curl -SL https://github.com/bblfsh/libuast/archive/v$(LIBUAST_VERSION).tar.gz | tar xz mv libuast-$(LIBUAST_VERSION)/src/* $(TOOLS_FOLDER)/. rm -rf libuast-$(LIBUAST_VERSION) -.PHONY: unix-dependencies \ No newline at end of file +.PHONY: unix-dependencies diff --git a/tools/uast.cc b/tools/uast.cc index 8128c8a..57e6ed8 100644 --- a/tools/uast.cc +++ b/tools/uast.cc @@ -281,8 +281,11 @@ Nodes *UastFilter(const Uast *ctx, NodeHandle node, const char *query) { auto nodeset = queryResult.xpathObj->nodesetval; if (!nodeset) { - Error(nullptr, "Unable to get array of result nodes\n"); + if (NodesSetSize(nodes, 0) != 0) { + Error(nullptr, "Unable to set nodes size\n"); throw std::runtime_error(""); + } + return nodes; } auto results = nodeset->nodeTab;