diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 24e2b22c..658a2b4d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -13292,7 +13292,7 @@ void View::DrawAnnotationList() void View::DrawSampleParents() { const auto symbol = m_worker.GetSymbolData( m_sampleParents.symAddr ); - const auto stats = m_worker.GetSymbolStats( m_sampleParents.symAddr ); + const auto stats = *m_worker.GetSymbolStats( m_sampleParents.symAddr ); assert( !stats.parents.empty() ); bool show = true; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 4d862ea1..7488d736 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2349,12 +2349,18 @@ const Worker::SourceLocationZones& Worker::GetZonesForSourceLocation( int16_t sr return it != m_data.sourceLocationZones.end() ? it->second : empty; } -const SymbolStats& Worker::GetSymbolStats( uint64_t symAddr ) const +const SymbolStats* Worker::GetSymbolStats( uint64_t symAddr ) const { assert( AreCallstackSamplesReady() ); auto it = m_data.symbolStats.find( symAddr ); - assert( it != m_data.symbolStats.end() ); - return it->second; + if( it == m_data.symbolStats.end() ) + { + return nullptr; + } + else + { + return &it->second; + } } #endif diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 97ac7ca6..b07075b8 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -448,7 +448,7 @@ public: const unordered_flat_map& GetSymbolMap() const { return m_data.symbolMap; } const unordered_flat_map& GetSymbolStats() const { return m_data.symbolStats; } - const SymbolStats& GetSymbolStats( uint64_t symAddr ) const; + const SymbolStats* GetSymbolStats( uint64_t symAddr ) const; bool AreCallstackSamplesReady() const { return m_data.callstackSamplesReady; } #endif