Added null check to exception message formatting
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<TargetFrameworks>.netstandard2.1; net6.0; net7.0; net8.0; net4.8;</TargetFrameworks>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<FileVersion>1.2.8</FileVersion>
|
||||
<FileVersion>1.2.9</FileVersion>
|
||||
<Authors>EonaCat (Jeroen Saey)</Authors>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Company>EonaCat (Jeroen Saey)</Company>
|
||||
@@ -24,7 +24,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<EVRevisionFormat>1.2.8+{chash:10}.{c:ymd}</EVRevisionFormat>
|
||||
<EVRevisionFormat>1.2.9+{chash:10}.{c:ymd}</EVRevisionFormat>
|
||||
<EVDefault>true</EVDefault>
|
||||
<EVInfo>true</EVInfo>
|
||||
<EVTagMatch>v[0-9]*</EVTagMatch>
|
||||
|
||||
@@ -14,8 +14,14 @@ public static class ExceptionExtensions
|
||||
|
||||
var st = new StackTrace(exception, true);
|
||||
var frame = st.GetFrame(0);
|
||||
var fileLine = frame.GetFileLineNumber();
|
||||
var filename = frame.GetFileName();
|
||||
int fileLine = -1;
|
||||
string filename = "Unknown";
|
||||
|
||||
if (frame != null)
|
||||
{
|
||||
fileLine = frame.GetFileLineNumber();
|
||||
filename = frame.GetFileName();
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user