mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-03 17:39:25 +02:00
Null checks on SqliteSampleBlock::mpFactory
This commit is contained in:
parent
cce2c7b883
commit
4ca09d55a1
@ -325,7 +325,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
#endif
|
||||
|
||||
auto umodule = std::make_unique<Module>(files[i]);
|
||||
if (umodule->Load()) // it will get rejected if there are version problems
|
||||
if (umodule->Load()) // it will get rejected if there are version problems
|
||||
{
|
||||
auto module = umodule.get();
|
||||
|
||||
|
@ -300,9 +300,11 @@ SqliteSampleBlock::SqliteSampleBlock(
|
||||
|
||||
SqliteSampleBlock::~SqliteSampleBlock()
|
||||
{
|
||||
auto &callback = mpFactory->mCallback;
|
||||
if (callback)
|
||||
GuardedCall( [&]{ callback( *this ); } );
|
||||
if (mpFactory) {
|
||||
auto &callback = mpFactory->mCallback;
|
||||
if (callback)
|
||||
GuardedCall( [&]{ callback( *this ); } );
|
||||
}
|
||||
|
||||
if (IsSilent()) {
|
||||
// The block object was constructed but failed to Load() or Commit().
|
||||
@ -330,6 +332,9 @@ SqliteSampleBlock::~SqliteSampleBlock()
|
||||
|
||||
DBConnection *SqliteSampleBlock::Conn() const
|
||||
{
|
||||
if (!mpFactory)
|
||||
return nullptr;
|
||||
|
||||
auto &pConnection = mpFactory->mppConnection->mpConnection;
|
||||
if (!pConnection) {
|
||||
throw SimpleMessageBoxException
|
||||
|
Loading…
x
Reference in New Issue
Block a user