diff data/model/WaveFileModel.cpp @ 292:8c5762634f42

* avoid crash if m_reader is null
author Chris Cannam
date Fri, 24 Aug 2007 14:45:29 +0000
parents 92e8dbde73cd
children c022976d18e8
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();
 }