[PD] remove superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-17 15:32:23 +02:00
parent ac6235c577
commit 16b25c5dab
17 changed files with 29 additions and 29 deletions

View File

@@ -498,7 +498,7 @@ int ComboLinks::addLink(const App::PropertyLinkSub &lnk, QString itemText)
this->linksInList.push_back(new App::PropertyLinkSub());
App::PropertyLinkSub &newitem = *(linksInList[linksInList.size()-1]);
newitem.Paste(lnk);
if (newitem.getValue() && this->doc == nullptr)
if (newitem.getValue() && !this->doc)
this->doc = newitem.getValue()->getDocument();
return linksInList.size()-1;
}
@@ -511,7 +511,7 @@ int ComboLinks::addLink(App::DocumentObject *linkObj, std::string linkSubname, Q
this->linksInList.push_back(new App::PropertyLinkSub());
App::PropertyLinkSub &newitem = *(linksInList[linksInList.size()-1]);
newitem.setValue(linkObj,std::vector<std::string>(1,linkSubname));
if (newitem.getValue() && this->doc == nullptr)
if (newitem.getValue() && !this->doc)
this->doc = newitem.getValue()->getDocument();
return linksInList.size()-1;
}