File tree Expand file tree Collapse file tree
Code/UsingMSBuildCopyOutputFileToFastDebug Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
2- using System . Diagnostics ;
3- using System . Dynamic ;
4- using System . Globalization ;
52using System . IO ;
6- using System . Runtime . Serialization . Json ;
7- using System . Text . Json ;
8- using System . Text . Json . Serialization ;
9- using System . Xml ;
10- using Lsj . Util . Collections ;
11- using Lsj . Util . JSON ;
123using Newtonsoft . Json ;
134using Newtonsoft . Json . Linq ;
145
@@ -30,11 +21,21 @@ public bool Execute()
3021 var text = File . ReadAllText ( file ) ;
3122
3223 var root = ( JObject ) JsonConvert . DeserializeObject ( text ) ;
24+ if ( root == null )
25+ {
26+ return false ;
27+ }
28+
3329 var profilesObject = ( JObject ) root [ "profiles" ] ;
3430
31+ if ( profilesObject == null )
32+ {
33+ return false ;
34+ }
35+
3536 foreach ( var keyValuePair in profilesObject )
3637 {
37- var commandName = keyValuePair . Value [ "commandName" ] ;
38+ var commandName = keyValuePair . Value ? [ "commandName" ] ;
3839 if ( commandName ? . ToString ( ) == "Executable" )
3940 {
4041 var executablePath = keyValuePair . Value [ "executablePath" ] ;
Original file line number Diff line number Diff line change 1414 <PrivateAssets >all</PrivateAssets >
1515 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
1616 </PackageReference >
17- <PackageReference Include =" Lsj.Util.JSON" Version =" 5.1.1" />
1817 <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.1" />
1918 </ItemGroup >
2019</Project >
You can’t perform that action at this time.
0 commit comments