mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Fix Coverity false positive for null-pointer dereference
This commit is contained in:
parent
3c094c739b
commit
af5257b6c3
@ -946,16 +946,17 @@ void docbookParagraphs(Text const &text,
|
|||||||
docstring id = docstring();
|
docstring id = docstring();
|
||||||
for (pos_type i = 0; i < par->size(); ++i) {
|
for (pos_type i = 0; i < par->size(); ++i) {
|
||||||
Inset const *inset = par->getInset(i);
|
Inset const *inset = par->getInset(i);
|
||||||
if (inset && dynamic_cast<InsetLabel const *>(inset)) {
|
if (inset) {
|
||||||
// Generate the attributes for the section if need be.
|
if (auto label = dynamic_cast<InsetLabel const *>(inset)) {
|
||||||
auto label = dynamic_cast<InsetLabel const *>(inset);
|
// Generate the attributes for the section if need be.
|
||||||
id += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
|
id += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
|
||||||
|
|
||||||
// Don't output the ID as a DocBook <anchor>.
|
// Don't output the ID as a DocBook <anchor>.
|
||||||
ourparams.docbook_anchors_to_ignore.emplace(label->screenLabel());
|
ourparams.docbook_anchors_to_ignore.emplace(label->screenLabel());
|
||||||
|
|
||||||
// Cannot have multiple IDs per tag.
|
// Cannot have multiple IDs per tag.
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user