mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-17 07:46:36 +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;
|
||||
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
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