mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Null checks on SqliteSampleBlock::mpFactory
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user