Fix CS0168 warning

This commit is contained in:
YoshiRulz 2023-04-15 15:37:27 +10:00
parent 85a481f93f
commit da65ad6226
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 7 additions and 4 deletions

View File

@ -27,14 +27,17 @@ public class VersionInfoGenerator : ISourceGenerator
git.WaitForExit(); git.WaitForExit();
return git.StandardOutput.ReadLine(); return git.StandardOutput.ReadLine();
} }
#if DEBUG
catch (Exception e) catch (Exception e)
{ {
#if DEBUG
return $"{e.GetType()}: {e.Message}"; return $"{e.GetType()}: {e.Message}";
#else
return null;
#endif
} }
#else
catch (Exception)
{
return null;
}
#endif
} }
public void Execute(GeneratorExecutionContext context) public void Execute(GeneratorExecutionContext context)