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
10
10
{
11
11
public class RuntimeConfig
12
12
{
13
- public List < RunningProcess > Processes { get ; set ; }
13
+ public List < RunningProcess > Processes { get ; set ; } = new List < RunningProcess > ( ) ;
14
14
15
15
public static string GetDefaultFileName ( )
16
16
{
@@ -28,7 +28,11 @@ public void Save()
28
28
public static void Update ( int port )
29
29
{
30
30
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 ( ) ;
32
36
var id = Process . GetCurrentProcess ( ) . Id ;
33
37
runtimeConfig . Processes . RemoveAll ( p => p . ID == id ) ;
34
38
runtimeConfig . Processes . Add ( new RunningProcess ( id , port ) ) ;
You can’t perform that action at this time.
0 commit comments