From 2e1aa844fe232a006e37ea85a766bf3333b97923 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Mar 2020 15:06:36 +0100 Subject: [PATCH] Don't try to open invalid files. --- server/TracySourceView.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 7e56bc3d..2982fca3 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -4,6 +4,7 @@ #include #include "../imgui/imgui.h" +#include "TracyFilesystem.hpp" #include "TracyImGui.hpp" #include "TracyPrint.hpp" #include "TracySourceView.hpp" @@ -371,7 +372,14 @@ void SourceView::Render( const Worker& worker ) auto sym = worker.GetSymbolData( jumpOut ); if( sym ) { - Open( worker.GetString( sym->file ), sym->line, jumpOut, jumpOut, worker ); + auto line = sym->line; + auto file = line == 0 ? nullptr : worker.GetString( sym->file ); + if( file && !SourceFileValid( file, worker.GetCaptureTime() ) ) + { + file = nullptr; + line = 0; + } + Open( file, line, jumpOut, jumpOut, worker ); } } }