From 7b67723da9a3a6c40b97b98dd7231090e3ff740b Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Tue, 23 Jul 2024 16:14:31 +0100 Subject: [PATCH] Fix error if the preview iframe does not have the userbar loaded --- client/src/includes/previewPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/includes/previewPlugin.ts b/client/src/includes/previewPlugin.ts index d708e363c2..6258cff4a3 100644 --- a/client/src/includes/previewPlugin.ts +++ b/client/src/includes/previewPlugin.ts @@ -34,7 +34,7 @@ export const wagtailPreviewPlugin: AxePlugin = { // Inside the preview frame, only call the expected plugin instance method. // eslint-disable-next-line no-underscore-dangle const pluginInstance = this._registry[id]; - pluginInstance[action].call(pluginInstance, options, callback); + pluginInstance?.[action].call(pluginInstance, options, callback); } }, commands: [