From 399886c25c8d74b6ff3060b7db2a488bc2712890 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 30 Mar 2015 15:58:33 +0200 Subject: [PATCH] Sound engine: don't open() inexistent files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid error “QIODevice::read: device not open” --- cockatrice/src/soundengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cockatrice/src/soundengine.cpp b/cockatrice/src/soundengine.cpp index 89820f9d..d1f5c214 100644 --- a/cockatrice/src/soundengine.cpp +++ b/cockatrice/src/soundengine.cpp @@ -22,6 +22,8 @@ void SoundEngine::cacheData() << "notification" << "draw" << "playcard" << "shuffle" << "tap" << "untap" << "cuckoo"; for (int i = 0; i < fileNames.size(); ++i) { QFile file(settingsCache->getSoundPath() + "/" + fileNames[i] + ".raw"); + if(!file.exists()) + continue; file.open(QIODevice::ReadOnly); audioData.insert(fileNames[i], file.readAll()); file.close();