File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/Files.App/UserControls/FilePreviews Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11using Files . App . ViewModels . Previews ;
2+ using Microsoft . Extensions . Logging ;
23using Microsoft . UI . Xaml . Controls ;
4+ using System . IO ;
35
46// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
57
@@ -17,7 +19,14 @@ public RichTextPreview(RichTextPreviewViewModel viewModel)
1719
1820 private void TextPreviewControl_Loaded ( object sender , Microsoft . UI . Xaml . RoutedEventArgs e )
1921 {
20- TextPreviewControl . Document . LoadFromStream ( Microsoft . UI . Text . TextSetOptions . FormatRtf , ViewModel . Stream ) ;
22+ try
23+ {
24+ TextPreviewControl . Document . LoadFromStream ( Microsoft . UI . Text . TextSetOptions . FormatRtf , ViewModel . Stream ) ;
25+ }
26+ catch ( EndOfStreamException ex )
27+ {
28+ App . Logger . LogWarning ( ex , ex . Message ) ;
29+ }
2130 }
2231 }
2332}
You can’t perform that action at this time.
0 commit comments