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/printer_yang.c b/src/printer_yang.c
index 95ba4f3..5833a15 100644
--- a/src/printer_yang.c
+++ b/src/printer_yang.c
@@ -2347,7 +2347,7 @@
LEVEL++;
yprc_extension_instances(ctx, LY_STMT_EXTENSION_INSTANCE, 0, ext[u].exts, &inner_flag, 0);
- if (ext[u].def->plugin->sprinter) {
+ if (ext[u].def->plugin && ext[u].def->plugin->sprinter) {
ext[u].def->plugin->sprinter(&ctx->printer_ctx, &ext[u], &inner_flag);
}