File fix-crash.patch of Package amarok4

diff --git a/src/core-impl/collections/db/MountPointManager.cpp b/src/core-impl/collections/db/MountPointManager.cpp
index ebc15ccb3e..3895574937 100644
--- a/src/core-impl/collections/db/MountPointManager.cpp
+++ b/src/core-impl/collections/db/MountPointManager.cpp
@@ -247,6 +247,7 @@ MountPointManager::getRelativePath( const int deviceId, const QString& absoluteP
     if ( deviceId != -1 && m_handlerMap.contains( deviceId ) )
     {
         //FIXME max: returns garbage if the absolute path is actually not under the device's mount point
+        qDebug() << "getDevicePath() =" << m_handlerMap[deviceId]->getDevicePath() << "\nresult:" << KUrl::relativePath( m_handlerMap[deviceId]->getDevicePath(), absolutePath );
         return KUrl::relativePath( m_handlerMap[deviceId]->getDevicePath(), absolutePath );
     }
     else
diff --git a/src/core-impl/collections/db/sql/SqlRegistry.cpp b/src/core-impl/collections/db/sql/SqlRegistry.cpp
index 6a77f917b2..5742de89b9 100644
--- a/src/core-impl/collections/db/sql/SqlRegistry.cpp
+++ b/src/core-impl/collections/db/sql/SqlRegistry.cpp
@@ -81,6 +81,7 @@ SqlRegistry::getDirectory( const QString &path, uint mtime )
     int dirId;
     int deviceId = m_collection->mountPointManager()->getIdForUrl( path );
     QString rdir = m_collection->mountPointManager()->getRelativePath( deviceId, path );
+qDebug() << "Wolfi: SqlRegistry::getDirectory() called, path =" << path << ", deviceId =" << deviceId << ", rdir =" << rdir;
 
     SqlStorage *storage = m_collection->sqlStorage();
 
@@ -124,6 +125,7 @@ SqlRegistry::getDirectory( const QString &path, uint mtime )
 Meta::TrackPtr
 SqlRegistry::getTrack( int urlId )
 {
+qDebug() << "Wolfi: SqlRegistry::getTrack() called, urlId =" << urlId;
     QString query = "SELECT %1 FROM urls %2 "
         "WHERE urls.id = %3";
     query = query.arg( Meta::SqlTrack::getTrackReturnValues(),
@@ -171,6 +171,7 @@ SqlRegistry::getTrack( const QString &path )
 {
     int deviceId = m_collection->mountPointManager()->getIdForUrl( path );
     QString rpath = m_collection->mountPointManager()->getRelativePath( deviceId, path );
+qDebug() << "Wolfi: SqlRegistry::getTrack() called, path =" << path << ", deviceId =" << deviceId << ", rpath =" << rpath;
     TrackPath id( deviceId, rpath );
 
     QMutexLocker locker( &m_trackMutex );
diff --git a/src/scripting/scriptconsole/ScriptConsole.cpp b/src/scripting/scriptconsole/ScriptConsole.cpp
index e4e0fab03e..651333d3b9 100644
--- a/src/scripting/scriptconsole/ScriptConsole.cpp
+++ b/src/scripting/scriptconsole/ScriptConsole.cpp
@@ -55,7 +55,7 @@ ScriptConsole::instance()
 //private
 
 ScriptConsole::ScriptConsole( QWidget *parent )
-    : QMainWindow( parent, Qt::Window )
+    : QMainWindow( parent, Qt::Window ), m_debugger( NULL )
 {
     m_editor = KTextEditor::EditorChooser::editor();
     if ( !m_editor )
@@ -243,7 +243,9 @@ ScriptConsole::createScriptItem( const QString &script )
 
 ScriptConsole::~ScriptConsole()
 {
-    m_debugger->detach();
+    if( m_debugger ) {
+        m_debugger->detach();
+    }
 }
 
 void
openSUSE Build Service is sponsored by