mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 12:51:15 +02:00
Fix crash in Assets.getAsset() when callback undefined
This commit is contained in:
parent
a9fe2bf415
commit
746f97a0e0
1 changed files with 4 additions and 1 deletions
|
@ -249,8 +249,11 @@ void AssetScriptingInterface::getAsset(QScriptValue options, QScriptValue scope,
|
|||
QString("Invalid responseType: '%1' (expected: %2)").arg(responseType).arg(RESPONSE_TYPES.join(" | ")));
|
||||
|
||||
Promise fetched = jsPromiseReady(makePromise("fetched"), scope, callback);
|
||||
Promise mapped = makePromise("mapped");
|
||||
if (!fetched) {
|
||||
return;
|
||||
}
|
||||
|
||||
Promise mapped = makePromise("mapped");
|
||||
mapped->fail(fetched);
|
||||
mapped->then([=](QVariantMap result) {
|
||||
QString hash = result.value("hash").toString();
|
||||
|
|
Loading…
Reference in a new issue