mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 07:52:55 +02:00
Fix invalid remote scripts being loaded
This commit is contained in:
parent
5843425db9
commit
89fbeb0b6d
1 changed files with 6 additions and 1 deletions
|
@ -147,7 +147,12 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL,
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||||
loop.exec();
|
loop.exec();
|
||||||
_scriptContents = reply->readAll();
|
if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) == 200) {
|
||||||
|
_scriptContents = reply->readAll();
|
||||||
|
} else {
|
||||||
|
qDebug() << "ERROR Loading file:" << url.toString();
|
||||||
|
emit errorMessage("ERROR Loading file:" + url.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue