Gui: add security checks to view provider extensions because they can be accessed if a document objects is not yet attached

This commit is contained in:
wmayer
2024-04-06 02:12:04 +02:00
parent 262a218b6b
commit 15dcd1e9be
5 changed files with 30 additions and 13 deletions

View File

@@ -77,8 +77,9 @@ QIcon ViewProviderAttachExtension::extensionMergeColorfullOverlayIcons (const QI
void ViewProviderAttachExtension::extensionUpdateData(const App::Property* prop)
{
if (getExtendedViewProvider()->getObject()->hasExtension(Part::AttachExtension::getExtensionClassTypeId())) {
auto* attach = getExtendedViewProvider()->getObject()->getExtensionByType<Part::AttachExtension>();
auto obj = getExtendedViewProvider()->getObject();
if (obj && obj->hasExtension(Part::AttachExtension::getExtensionClassTypeId())) {
auto* attach = obj->getExtensionByType<Part::AttachExtension>();
if(attach) {
if( prop == &(attach->AttachmentSupport) ||