Skip to content

Commit

Permalink
Fix issue with removed to the recycle bin locations models as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkanovikov committed Nov 30, 2022
1 parent 84ccccb commit 087fc10
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ BusinessLayer::AbstractModel* ProjectModelsFacade::modelFor(Domain::DocumentObje
for (const auto characterDocument : characterDocuments) {
const auto characterItem
= d->projectStructureModel->itemForUuid(characterDocument->uuid());
if (characterItem->parent()->uuid() != _document->uuid()) {
if (characterItem == nullptr
|| characterItem->parent()->uuid() != _document->uuid()) {
continue;
}

Expand Down Expand Up @@ -823,6 +824,13 @@ BusinessLayer::AbstractModel* ProjectModelsFacade::modelFor(Domain::DocumentObje
= DataStorageLayer::StorageFacade::documentStorage()->documents(
Domain::DocumentObjectType::Location);
for (const auto locationDocument : locationDocuments) {
const auto locationItem
= d->projectStructureModel->itemForUuid(locationDocument->uuid());
if (locationItem == nullptr
|| locationItem->parent()->uuid() != _document->uuid()) {
continue;
}

auto locationModel = modelFor(locationDocument);
locationsModel->addLocationModel(
qobject_cast<BusinessLayer::LocationModel*>(locationModel));
Expand Down

0 comments on commit 087fc10

Please sign in to comment.