This repository was archived by the owner on Jun 20, 2023. It is now read-only.
File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -375,10 +375,14 @@ Task ("nuget-setup").IsDependentOn ("buildtasks").IsDependentOn ("externals")
375
375
// Check if we have a proguard.txt file for this artifact and include it in the nuspec if so
376
376
if ( FileExists ( proguardFile ) ) {
377
377
Information ( "Adding {0} to {1}" , "proguard.txt" , nuspecFile ) ;
378
- var filesElem = xNuspec . Root . Descendants ( nsNuspec + "files" ) ? . FirstOrDefault ( ) ;
379
- filesElem . Add ( new System . Xml . Linq . XElement ( nsNuspec + "file" ,
380
- new System . Xml . Linq . XAttribute ( nsNuspec + "src" , proguardFile . ToString ( ) ) ,
381
- new System . Xml . Linq . XAttribute ( nsNuspec + "target" , "proguard/proguard.txt" ) ) ) ;
378
+ var filesElems = xNuspec . Root . Descendants ( nsNuspec + "files" ) ;
379
+
380
+ if ( filesElems != null ) {
381
+ var filesElem = filesElems . First ( ) ;
382
+ filesElem . Add ( new System . Xml . Linq . XElement ( nsNuspec + "file" ,
383
+ new System . Xml . Linq . XAttribute ( nsNuspec + "src" , proguardFile . ToString ( ) ) ,
384
+ new System . Xml . Linq . XAttribute ( nsNuspec + "target" , "proguard/proguard.txt" ) ) ) ;
385
+ }
382
386
}
383
387
384
388
xNuspec . Save ( MakeAbsolute ( nuspecFile ) . FullPath ) ;
You can’t perform that action at this time.
0 commit comments