Avoid null pointer dereference

Spotted by coverity. In the real world, getInset should never return
nullptr when isInset is true.
This commit is contained in:
Jean-Marc Lasgouttes 2022-02-20 17:22:07 +01:00
parent a900667ea1
commit b365a47112

View File

@ -2367,8 +2367,8 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
&& !layout_->pass_thru
&& curAlign != LYX_ALIGN_CENTER) {
if (!owner_->empty()
&& (owner_->isInset(0)
&& owner_->getInset(0)->lyxCode() == VSPACE_CODE))
&& owner_->getInset(0)
&& owner_->getInset(0)->lyxCode() == VSPACE_CODE)
// If the paragraph starts with a vspace, the \\noindent
// needs to come after that (as it leaves vmode).
// If the paragraph consists only of the vspace,