From 5f6522267137a41c151d0ba733a5ea982968978f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 27 Jun 2020 14:00:52 +0300 Subject: [PATCH] #4471 Don't throw exception on IOSPlatformProvider.GetCurrentOSPlatform() --- .../System/Runtime/OSPlatformProvider.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/framework/src/Volo.Abp.Core/System/Runtime/OSPlatformProvider.cs b/framework/src/Volo.Abp.Core/System/Runtime/OSPlatformProvider.cs index d2b05aac60..89b57acaab 100644 --- a/framework/src/Volo.Abp.Core/System/Runtime/OSPlatformProvider.cs +++ b/framework/src/Volo.Abp.Core/System/Runtime/OSPlatformProvider.cs @@ -5,17 +5,11 @@ namespace System.Runtime { public class OSPlatformProvider : IOSPlatformProvider, ITransientDependency { - public OSPlatform GetCurrentOSPlatform() + public virtual OSPlatform GetCurrentOSPlatform() { if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - //MAC - return OSPlatform.OSX; - } - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - return OSPlatform.Linux; + return OSPlatform.OSX; //MAC } if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -23,7 +17,7 @@ namespace System.Runtime return OSPlatform.Windows; } - throw new Exception("Cannot determine operating system!"); + return OSPlatform.Linux; } } }