changeset 292:8c5762634f42

* avoid crash if m_reader is null
author Chris Cannam
date Fri, 24 Aug 2007 14:45:29 +0000
parents 42e6c8360df1
children 7c53640bb9ba
files data/model/WaveFileModel.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/WaveFileModel.cpp	Fri Aug 24 14:45:11 2007 +0000
+++ b/data/model/WaveFileModel.cpp	Fri Aug 24 14:45:29 2007 +0000
@@ -47,7 +47,7 @@
     m_exiting(false)
 {
     m_reader = AudioFileReaderFactory::createReader(path);
-    setObjectName(m_reader->getTitle());
+    if (m_reader) setObjectName(m_reader->getTitle());
     if (objectName() == "") setObjectName(QFileInfo(path).fileName());
     if (isOK()) fillCache();
 }
@@ -61,7 +61,7 @@
     m_exiting(false)
 {
     m_reader = AudioFileReaderFactory::createReader(path);
-    setObjectName(m_reader->getTitle());
+    if (m_reader) setObjectName(m_reader->getTitle());
     if (objectName() == "") setObjectName(QFileInfo(originalLocation).fileName());
     if (isOK()) fillCache();
 }
@@ -75,7 +75,7 @@
     m_exiting(false)
 {
     m_reader = reader;
-    setObjectName(m_reader->getTitle());
+    if (m_reader) setObjectName(m_reader->getTitle());
     if (objectName() == "") setObjectName(QFileInfo(path).fileName());
     fillCache();
 }