File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
src/runtime/StateSerialization Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,16 @@ public static class RuntimeData
18
18
19
19
public readonly static Func < IFormatter > DefaultFormatterFactory = ( ) =>
20
20
{
21
- var fw = RuntimeInformation . FrameworkDescription ?? "undefined" ;
22
- if ( fw . StartsWith ( ".NET Framework" ) || fw . StartsWith ( "Mono" ) )
21
+ try
23
22
{
24
- try
23
+ var fw = RuntimeInformation . FrameworkDescription ;
24
+ if ( fw . StartsWith ( ".NET Framework" ) || fw . StartsWith ( "Mono" ) )
25
25
{
26
26
return new BinaryFormatter ( ) ;
27
27
}
28
- catch
29
- {
30
- return new NoopFormatter ( ) ;
31
- }
32
- }
33
- else
34
- {
35
- return new NoopFormatter ( ) ;
36
28
}
29
+ catch { }
30
+ return new NoopFormatter ( ) ;
37
31
} ;
38
32
39
33
private static Func < IFormatter > _formatterFactory { get ; set ; } = DefaultFormatterFactory ;
You can’t perform that action at this time.
0 commit comments