schema BUGFIX accessing extension plugins
The plugin in extension is not mandatory, so be more careful when
accessing plugin's callbacks and check that the plugin is actually
present.
Fixes #1492
diff --git a/src/validation.c b/src/validation.c
index 86d47d8..b97a415 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -257,7 +257,7 @@
struct node_ext *rec;
LY_ARRAY_FOR(exts, const struct lysc_ext_instance, ext) {
- if (ext->def->plugin->validate) {
+ if (ext->def->plugin && ext->def->plugin->validate) {
rec = malloc(sizeof *rec);
LY_CHECK_ERR_RET(!rec, LOGMEM(LYD_CTX(node)), LY_EMEM);
rec->ext = ext;