@@ -31,26 +31,32 @@ public App(string path, IEngine engine)
31
31
if ( Settings . PublicVersion > 0 )
32
32
{
33
33
var versionDirectory = versions . FirstOrDefault ( x => x . Contains ( $ "version_{ Settings . PublicVersion } ") ) ;
34
- var versionPath = System . IO . Path . Combine ( versionDirectory , "App.config.json" ) ;
35
- if ( File . Exists ( versionPath ) )
34
+ if ( ! String . IsNullOrEmpty ( versionDirectory ) )
36
35
{
37
- var version = JsonConvert . DeserializeObject < AppVersion > ( File . ReadAllText ( versionPath ) , new TypeConverter ( ) ) ;
38
- version . Path = versionPath ;
39
- Versions . Add ( version ) ;
40
- }
36
+ var versionPath = System . IO . Path . Combine ( versionDirectory , "App.config.json" ) ;
37
+ if ( File . Exists ( versionPath ) )
38
+ {
39
+ var version = JsonConvert . DeserializeObject < AppVersion > ( File . ReadAllText ( versionPath ) , new TypeConverter ( ) ) ;
40
+ version . Path = versionPath ;
41
+ Versions . Add ( version ) ;
42
+ }
43
+ }
41
44
}
42
45
43
46
// Load latest draft version
44
47
if ( Settings . DraftVersion > 0 )
45
48
{
46
49
var versionDirectory = versions . FirstOrDefault ( x => x . Contains ( $ "version_{ Settings . DraftVersion } ") ) ;
47
- var versionPath = System . IO . Path . Combine ( versionDirectory , "App.config.json" ) ;
48
- if ( File . Exists ( versionPath ) )
50
+ if ( ! String . IsNullOrEmpty ( versionDirectory ) )
49
51
{
50
- var version = JsonConvert . DeserializeObject < AppVersion > ( File . ReadAllText ( versionPath ) , new TypeConverter ( ) ) ;
51
- version . Path = versionPath ;
52
- Versions . Add ( version ) ;
53
- }
52
+ var versionPath = System . IO . Path . Combine ( versionDirectory , "App.config.json" ) ;
53
+ if ( File . Exists ( versionPath ) )
54
+ {
55
+ var version = JsonConvert . DeserializeObject < AppVersion > ( File . ReadAllText ( versionPath ) , new TypeConverter ( ) ) ;
56
+ version . Path = versionPath ;
57
+ Versions . Add ( version ) ;
58
+ }
59
+ }
54
60
}
55
61
}
56
62
0 commit comments