File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ static void InitializeProviderRegistration ()
228
228
providerCache = new Dictionary < Guid , MSI . MonoTlsProvider > ( ) ;
229
229
230
230
#if UNITY
231
- if ( Mono . Unity . UnityTls . IsSupported ( ) )
231
+ if ( Mono . Unity . UnityTls . IsSupported )
232
232
{
233
233
var unityTlsEntry = new Tuple < Guid , String > ( UnityTlsId , "Mono.Unity.UnityTlsProvider" ) ;
234
234
providerRegistration . Add ( "default" , unityTlsEntry ) ;
Original file line number Diff line number Diff line change @@ -235,21 +235,18 @@ public class mono_unity_unitytls_interface
235
235
236
236
private static mono_unity_unitytls_interface marshalledInterface = null ;
237
237
238
- public static bool IsSupported ( )
239
- {
240
- try {
241
- return NativeInterface != null ;
242
- } catch ( System . Exception ) {
243
- return false ;
244
- }
245
- }
238
+ public static bool IsSupported => NativeInterface != null ;
246
239
247
240
public static mono_unity_unitytls_interface NativeInterface
248
241
{
249
242
get
250
243
{
251
- if ( marshalledInterface == null )
252
- marshalledInterface = Marshal . PtrToStructure < mono_unity_unitytls_interface > ( mono_unity_get_unitytls_interface ( ) ) ;
244
+ if ( marshalledInterface == null ) {
245
+ IntPtr rawInterface = mono_unity_get_unitytls_interface ( ) ;
246
+ if ( rawInterface == IntPtr . Zero )
247
+ return null ;
248
+ marshalledInterface = Marshal . PtrToStructure < mono_unity_unitytls_interface > ( rawInterface ) ;
249
+ }
253
250
return marshalledInterface ;
254
251
}
255
252
}
You can’t perform that action at this time.
0 commit comments