From: Jean-Marc Lasgouttes Date: Sun, 20 Feb 2022 16:09:49 +0000 (+0100) Subject: Avoid null pointer dereference X-Git-Tag: 2.4-beta2~836 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a900667ea1bb516ac562a6c45e4f3a1e4071b01b;p=lyx.git Avoid null pointer dereference Spotted by coverity. --- diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index b375c0ec38..dc3f7c5e35 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -400,7 +400,7 @@ void Loader::Impl::resetFile(FileName const & file) // new file. bool continue_monitoring = false; - if (!old_file.empty()) { + if (cached_item_ && !old_file.empty()) { continue_monitoring = cached_item_->monitoring(); // cached_item_ is going to be reset, so the connected // signal needs to be disconnected.