File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/Files.App/Services/Windows Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) 2024 Files Community
22// Licensed under the MIT License. See the LICENSE.
33
4+ using System . IO ;
5+
46namespace Files . App . Services
57{
68 /// <inheritdoc cref="IWindowsIniService"/>
@@ -9,19 +11,18 @@ public sealed class WindowsIniService : IWindowsIniService
911 /// <inheritdoc/>
1012 public List < IniSectionDataItem > GetData ( string filePath )
1113 {
12- var iniPath = SystemIO . Path . Combine ( filePath ) ;
13- if ( ! SystemIO . File . Exists ( iniPath ) )
14+ if ( ! File . Exists ( filePath ) )
1415 return [ ] ;
1516
1617 var lines = Enumerable . Empty < string > ( ) . ToList ( ) ;
1718
1819 try
1920 {
20- lines = SystemIO . File . ReadLines ( iniPath )
21+ lines = File . ReadLines ( filePath )
2122 . Where ( line => ! line . StartsWith ( ';' ) && ! string . IsNullOrEmpty ( line ) )
2223 . ToList ( ) ;
2324 }
24- catch ( UnauthorizedAccessException )
25+ catch ( Exception ex ) when ( ex is UnauthorizedAccessException || ex is FileNotFoundException )
2526 {
2627 return [ ] ;
2728 }
You can’t perform that action at this time.
0 commit comments