mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
Fix crash in Assets.setBakingEnabled() when callback undefined
This commit is contained in:
parent
746f97a0e0
commit
fb818c0726
1 changed files with 3 additions and 0 deletions
|
@ -127,6 +127,9 @@ void AssetScriptingInterface::setBakingEnabled(QString path, bool enabled, QScri
|
||||||
auto setBakingEnabledRequest = DependencyManager::get<AssetClient>()->createSetBakingEnabledRequest({ path }, enabled);
|
auto setBakingEnabledRequest = DependencyManager::get<AssetClient>()->createSetBakingEnabledRequest({ path }, enabled);
|
||||||
|
|
||||||
Promise deferred = jsPromiseReady(makePromise(__FUNCTION__), thisObject(), callback);
|
Promise deferred = jsPromiseReady(makePromise(__FUNCTION__), thisObject(), callback);
|
||||||
|
if (!deferred) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
connect(setBakingEnabledRequest, &SetBakingEnabledRequest::finished, setBakingEnabledRequest, [deferred](SetBakingEnabledRequest* request) {
|
connect(setBakingEnabledRequest, &SetBakingEnabledRequest::finished, setBakingEnabledRequest, [deferred](SetBakingEnabledRequest* request) {
|
||||||
Q_ASSERT(QThread::currentThread() == request->thread());
|
Q_ASSERT(QThread::currentThread() == request->thread());
|
||||||
|
|
Loading…
Reference in a new issue