nullptr safety

This commit is contained in:
Jeff Young 2025-01-18 16:12:02 +00:00
parent 6423571349
commit b582f178dd
2 changed files with 6 additions and 3 deletions

View File

@ -116,11 +116,14 @@ public:
if( static_cast<size_t>( itemIndex ) < jobs.size() )
{
JOBSET_JOB& job = jobs[itemIndex];
if( m_output->m_lastRunReporters.contains( job.m_id ) )
{
WX_STRING_REPORTER* reporter =
static_cast<WX_STRING_REPORTER*>( m_output->m_lastRunReporters[job.m_id] );
m_textCtrlOutput->SetValue( reporter->GetMessages() );
if( reporter )
m_textCtrlOutput->SetValue( reporter->GetMessages() );
}
else
{

View File

@ -178,8 +178,8 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
aOutput->m_lastRunSuccessMap.clear();
for( auto& reporter : aOutput->m_lastRunReporters )
delete reporter.second;
for( auto& [name, reporter] : aOutput->m_lastRunReporters )
delete reporter;
aOutput->m_lastRunReporters.clear();