Merge pull request #15801 from SimonWalton-HiFi/recording-playback-null-url

A null recording clip should be considered an error
This commit is contained in:
Shannon Romano 2019-06-19 17:58:46 -07:00 committed by GitHub
commit 80b118560d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -18,7 +18,13 @@
using namespace recording;
NetworkClipLoader::NetworkClipLoader(const QUrl& url) :
Resource(url),
_clip(std::make_shared<NetworkClip>(url)) {}
_clip(std::make_shared<NetworkClip>(url)) {
if (url.isEmpty()) {
_loaded = false;
_startedLoading = false;
_failedToLoad = true;
}
}
void NetworkClip::init(const QByteArray& clipData) {
_clipData = clipData;

View file

@ -93,7 +93,7 @@ void RecordingScriptingInterface::loadRecording(const QString& url, QScriptValue
// when clip load fails, call the callback with the URL and failure boolean
connect(clipLoader.data(), &recording::NetworkClipLoader::failed, callback.engine(), [this, weakClipLoader, url, callback](QNetworkReply::NetworkError error) mutable {
qCDebug(scriptengine) << "Failed to load recording from" << url;
qCDebug(scriptengine) << "Failed to load recording from\"" << url << '"';
if (callback.isFunction()) {
QScriptValueList args { false, url };