From e3011a029611f66f3042bee4e575b01c3f79a5f0 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Fri, 2 Nov 2018 14:43:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9AExceptions?= =?UTF-8?q?=E5=AF=B9StackTrace=E5=81=9A=E7=A9=BA=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.DataAccess/Exceptions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bootstrap.DataAccess/Exceptions.cs b/Bootstrap.DataAccess/Exceptions.cs index fa377050..ffafaec0 100644 --- a/Bootstrap.DataAccess/Exceptions.cs +++ b/Bootstrap.DataAccess/Exceptions.cs @@ -71,6 +71,7 @@ namespace Bootstrap.DataAccess /// public virtual bool Log(Exception ex, NameValueCollection additionalInfo) { + if (ex == null) return true; if (additionalInfo == null) { additionalInfo = new NameValueCollection @@ -118,7 +119,7 @@ namespace Bootstrap.DataAccess UserIp = reader.IsDBNull(4) ? string.Empty : (string)reader[4], ExceptionType = (string)reader[5], Message = (string)reader[6], - StackTrace = (string)reader[7], + StackTrace = reader.IsDBNull(7) ? string.Empty : (string)reader[7], LogTime = (DateTime)reader[8], }); }