schema BUGFIX invalid error checking

checking presence of data at incorrect place in
lysp_ext_find_definition().
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 9417d13..1d2a8f2 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -1828,6 +1828,8 @@
     LY_ARRAY_COUNT_TYPE v;
     const struct lys_module *mod = NULL;
 
+    assert(ext_def);
+
     *ext_def = NULL;
     if (ext_mod) {
         *ext_mod = NULL;
@@ -1856,7 +1858,7 @@
         }
     }
 
-    if (!ext_def) {
+    if (!(*ext_def)) {
         LOGVAL(ctx, LYVE_REFERENCE, "Extension definition of extension instance \"%s\" not found.", ext->name);
         return LY_EVALID;
     }