History

Merge branch 'master' into DOC-59

David Rowe committed 7 years ago

Commit f384b792 parents 9457aed 9e5f26c1321 files · +46216 −1384Browse files

Showing the changes to libraries/script-engine/src/AssetScriptingInterface.cpp (1 of 1321 files). Show all

Unified · Split

libraries/script-engine/src/AssetScriptingInterface.cpp+7−1
@@ -132,6 +132,9 @@ void AssetScriptingInterface::setBakingEnabled(QString path, bool enabled, QScri · 131 unmodified lines
132132 auto setBakingEnabledRequest = DependencyManager::get<AssetClient>()->createSetBakingEnabledRequest({ path }, enabled);
133133
134134 Promise deferred = jsPromiseReady(makePromise(__FUNCTION__), thisObject(), callback);
135+ if (!deferred) {
136+ return;
137+ }
135138
136139 connect(setBakingEnabledRequest, &SetBakingEnabledRequest::finished, setBakingEnabledRequest, [deferred](SetBakingEnabledRequest* request) {
137140 Q_ASSERT(QThread::currentThread() == request->thread());
@@ -265,8 +268,11 @@ void AssetScriptingInterface::getAsset(QScriptValue options, QScriptValue scope, · 127 unmodified lines
265268 QString("Invalid responseType: '%1' (expected: %2)").arg(responseType).arg(RESPONSE_TYPES.join(" | ")));
266269
267270 Promise fetched = jsPromiseReady(makePromise("fetched"), scope, callback);
268− Promise mapped = makePromise("mapped");
271+ if (!fetched) {
272+ return;
273+ }
269274
275+ Promise mapped = makePromise("mapped");
270276 mapped->fail(fetched);
271277 mapped->then([=](QVariantMap result) {
272278 QString hash = result.value("hash").toString();