File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
src/Files.App/ViewModels/Properties/Items Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ private IValueConverter GetConverter()
217
217
/// Converts the property to a string to be displayed
218
218
/// </summary>
219
219
/// <returns></returns>
220
- private string ConvertToString ( )
220
+ private string ? ConvertToString ( )
221
221
{
222
222
// Don't attempt any convert null values
223
223
if ( Value is null )
@@ -227,13 +227,27 @@ private string ConvertToString()
227
227
228
228
if ( EnumeratedList is not null )
229
229
{
230
- var value = "" ;
231
- return EnumeratedList . TryGetValue ( Convert . ToInt32 ( Value ) , out value ) ? value . GetLocalizedResource ( ) : null ;
230
+ try
231
+ {
232
+ return EnumeratedList . TryGetValue ( Convert . ToInt32 ( Value ) , out var value ) ?
233
+ value . GetLocalizedResource ( ) : null ;
234
+ }
235
+ catch
236
+ {
237
+ return null ;
238
+ }
232
239
}
233
240
234
241
if ( DisplayFunction is not null )
235
242
{
236
- return DisplayFunction . Invoke ( Value ) ;
243
+ try
244
+ {
245
+ return DisplayFunction . Invoke ( Value ) ;
246
+ }
247
+ catch
248
+ {
249
+ return null ;
250
+ }
237
251
}
238
252
239
253
if ( Converter is not null )
You can’t perform that action at this time.
0 commit comments