mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 11:50:37 +02:00
Don't crash when getting an invalid dbcmd.
This commit is contained in:
@@ -341,6 +341,9 @@ Database::createCommandInstance(const QVariant& op, const source_ptr& source)
|
|||||||
const QString commandName = op.toMap().value( "command" ).toString();
|
const QString commandName = op.toMap().value( "command" ).toString();
|
||||||
|
|
||||||
dbcmd_ptr command = createCommandInstance( commandName );
|
dbcmd_ptr command = createCommandInstance( commandName );
|
||||||
|
if ( command.isNull() )
|
||||||
|
return command;
|
||||||
|
|
||||||
command->setSource( source );
|
command->setSource( source );
|
||||||
QJson::QObjectHelper::qvariant2qobject( op.toMap(), command.data() );
|
QJson::QObjectHelper::qvariant2qobject( op.toMap(), command.data() );
|
||||||
return command;
|
return command;
|
||||||
|
Reference in New Issue
Block a user