mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
Add a small guard to Artist::get and Album::get as they are called all over, and might be called after destruction of DB on shutdown
This commit is contained in:
parent
34672c7bed
commit
89009c09be
@ -38,6 +38,9 @@ Album::~Album()
|
||||
album_ptr
|
||||
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
|
||||
{
|
||||
if ( !Database::instance() || !Database::instance()->impl() )
|
||||
return album_ptr();
|
||||
|
||||
int albid = Database::instance()->impl()->albumId( artist->id(), name, autoCreate );
|
||||
if ( albid < 1 && autoCreate )
|
||||
return album_ptr();
|
||||
|
@ -38,6 +38,9 @@ Artist::~Artist()
|
||||
artist_ptr
|
||||
Artist::get( const QString& name, bool autoCreate )
|
||||
{
|
||||
if ( !Database::instance() || !Database::instance()->impl() )
|
||||
return artist_ptr();
|
||||
|
||||
int artid = Database::instance()->impl()->artistId( name, autoCreate );
|
||||
if ( artid < 1 && autoCreate )
|
||||
return artist_ptr();
|
||||
|
Loading…
x
Reference in New Issue
Block a user