File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -60,18 +60,18 @@ public partial async Task<bool> SaveFileAsync(SaveFileOptions options)
60
60
await options . Content . CopyToAsync ( file ) ;
61
61
}
62
62
var url = new NSUrl ( path , false ) ;
63
-
63
+
64
64
var picker = new UIDocumentPickerViewController ( new [ ] { url } ) ;
65
65
TaskCompletionSource < bool > filesTcs = new ( ) ;
66
66
picker . DidPickDocumentAtUrls += ( _ , e ) =>
67
67
{
68
68
filesTcs . TrySetResult ( e . Urls . Length > 0 ) ;
69
69
} ;
70
-
70
+
71
71
var controller = Platform . GetCurrentUIViewController ( ) ;
72
72
ArgumentNullException . ThrowIfNull ( controller ) ;
73
73
await controller . PresentViewControllerAsync ( picker , true ) ;
74
-
74
+
75
75
return await filesTcs . Task ;
76
76
}
77
77
@@ -84,10 +84,9 @@ public IosFile(NSUrl url)
84
84
this . url = url ;
85
85
}
86
86
87
- public string FileName
88
- => Path . GetFileName ( url . Path ! ) ;
87
+ public string FileName => url . Path is null ? "" : Path . GetFileName ( url . Path ) ;
89
88
90
- public FileResult ? FileResult => null ;
89
+ public FileResult ? FileResult => url . Path is null ? null : new ( url . Path ) ;
91
90
92
91
public Task < Stream > OpenReadAsync ( )
93
92
=> Task . FromResult ( new FileStream ( url . Path ! , FileMode . Open ) as Stream ) ;
You can’t perform that action at this time.
0 commit comments