File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
SG.CodeCoverage.Recorder/RecordingController Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ namespace SG.CodeCoverage.Recorder.RecordingController
1010{
1111 public class RuntimeConfig
1212 {
13- public List < RunningProcess > Processes { get ; set ; }
13+ public List < RunningProcess > Processes { get ; set ; } = new List < RunningProcess > ( ) ;
1414
1515 public static string GetDefaultFileName ( )
1616 {
@@ -28,7 +28,11 @@ public void Save()
2828 public static void Update ( int port )
2929 {
3030 var path = GetDefaultFileName ( ) ;
31- var runtimeConfig = Load ( path ) ;
31+ RuntimeConfig runtimeConfig ;
32+ if ( File . Exists ( path ) )
33+ runtimeConfig = Load ( path ) ;
34+ else
35+ runtimeConfig = new RuntimeConfig ( ) ;
3236 var id = Process . GetCurrentProcess ( ) . Id ;
3337 runtimeConfig . Processes . RemoveAll ( p => p . ID == id ) ;
3438 runtimeConfig . Processes . Add ( new RunningProcess ( id , port ) ) ;
You can’t perform that action at this time.
0 commit comments