Don't crash if we can't write to the moodbar cache

This commit is contained in:
David Sansome 2014-09-21 18:05:47 +10:00
parent 6b32ecec27
commit d24eaef2e5
1 changed files with 4 additions and 2 deletions

View File

@ -156,8 +156,10 @@ void MoodbarLoader::RequestFinished(MoodbarPipeline* request, const QUrl& url) {
metadata.setUrl(url);
QIODevice* cache_file = cache_->prepare(metadata);
cache_file->write(request->data());
cache_->insert(cache_file);
if (cache_file) {
cache_file->write(request->data());
cache_->insert(cache_file);
}
// Save the data alongside the original as well if we're configured to.
if (save_alongside_originals_) {