@@ -157,6 +157,15 @@ string resolvedDestinationPath
157157 try
158158 {
159159 assetFileSystemInfo = AssetFileSystemInfo . From ( assetRootPath , resolvedSourcePath ) ;
160+ if ( assetFileSystemInfo == null )
161+ {
162+ _logger . LogWarning (
163+ "No file system information found for '{SourcePath}' ({ResolvedSourcePath})" ,
164+ sourcePath ,
165+ resolvedSourcePath
166+ ) ;
167+ return BadRequest ( "Invalid source path" ) ;
168+ }
160169 }
161170 catch ( Exception exception )
162171 {
@@ -261,7 +270,7 @@ public IActionResult AssetsUpload([FromForm] string folder, [FromForm] List<IFor
261270 directoryInfo . Create ( ) ;
262271 }
263272
264- Dictionary < string , ( HttpStatusCode StatusCode , string ? Message ) > results = new ( ) ;
273+ Dictionary < string , ( HttpStatusCode StatusCode , string ? Message ) > results = [ ] ;
265274 foreach ( var file in files )
266275 {
267276 if ( results . ContainsKey ( file . FileName ) )
@@ -564,8 +573,8 @@ private bool TryGenerateUpdateManifestFrom(string subdirectory, [NotNullWhen(tru
564573 return false ;
565574 }
566575
567- HashSet < FileSystemInfo > visited = new ( ) ;
568- Queue < FileSystemInfo > scanQueue = new ( ) ;
576+ HashSet < FileSystemInfo > visited = [ ] ;
577+ Queue < FileSystemInfo > scanQueue = [ ] ;
569578 scanQueue . Enqueue ( assetSubdirectoryInfo ) ;
570579
571580 updateManifest = new UpdateManifest
@@ -646,7 +655,7 @@ private IActionResult StreamAssets(string subdirectory, List<string> assetNames)
646655 }
647656
648657 long totalSize = 0 ;
649- List < ( FileInfo Info , string Name ) > assets = new ( ) ;
658+ List < ( FileInfo Info , string Name ) > assets = [ ] ;
650659 foreach ( var assetName in assetNames )
651660 {
652661 var pathToAsset = Path . GetFullPath ( assetName , assetSubdirectoryPath ) ;
0 commit comments