diff --git a/src/HooksHandler.php b/src/HooksHandler.php index 475142f..fa01e95 100644 --- a/src/HooksHandler.php +++ b/src/HooksHandler.php @@ -140,6 +140,9 @@ public function onImageBeforeProduceHTML( ): bool { if ( $this->getConfig()->has( 'BootstrapComponentsModalReplaceImageTag' ) && $this->getConfig()->get( 'BootstrapComponentsModalReplaceImageTag' ) ) { + if ( !$file ) { + return true; + } $imageModal = new ImageModal( $linker, $title, $file, $this->getNestingController(), $this->getBootstrapComponentsService() );