diff options
-rw-r--r-- | common/resultprovider.h | 1 | ||||
-rw-r--r-- | common/store.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/common/resultprovider.h b/common/resultprovider.h index 5561ff2..b7d9272 100644 --- a/common/resultprovider.h +++ b/common/resultprovider.h | |||
@@ -342,6 +342,7 @@ public: | |||
342 | 342 | ||
343 | void addEmitter(const typename ResultEmitter<DomainType>::Ptr &emitter) | 343 | void addEmitter(const typename ResultEmitter<DomainType>::Ptr &emitter) |
344 | { | 344 | { |
345 | Q_ASSERT(emitter); | ||
345 | emitter->onAdded([this](const DomainType &value) { this->add(value); }); | 346 | emitter->onAdded([this](const DomainType &value) { this->add(value); }); |
346 | emitter->onModified([this](const DomainType &value) { this->modify(value); }); | 347 | emitter->onModified([this](const DomainType &value) { this->modify(value); }); |
347 | emitter->onRemoved([this](const DomainType &value) { this->remove(value); }); | 348 | emitter->onRemoved([this](const DomainType &value) { this->remove(value); }); |
diff --git a/common/store.cpp b/common/store.cpp index 2ee6695..9211b51 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -125,7 +125,11 @@ QSharedPointer<QAbstractItemModel> Store::loadModel(Query query) | |||
125 | if (facade) { | 125 | if (facade) { |
126 | Trace() << "Trying to fetch from resource " << resourceInstanceIdentifier; | 126 | Trace() << "Trying to fetch from resource " << resourceInstanceIdentifier; |
127 | auto result = facade->load(query); | 127 | auto result = facade->load(query); |
128 | aggregatingEmitter->addEmitter(result.second); | 128 | if (result.second) { |
129 | aggregatingEmitter->addEmitter(result.second); | ||
130 | } else { | ||
131 | Warning() << "Null emitter for resource " << resourceInstanceIdentifier; | ||
132 | } | ||
129 | result.first.template then<void>([&future]() { future.setFinished(); }).exec(); | 133 | result.first.template then<void>([&future]() { future.setFinished(); }).exec(); |
130 | } else { | 134 | } else { |
131 | Trace() << "Couldn' find a facade for " << resourceInstanceIdentifier; | 135 | Trace() << "Couldn' find a facade for " << resourceInstanceIdentifier; |