summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-21 19:57:10 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-21 19:57:10 +0700
commitd49ba56148bf0d41080f9450b235807cfb1ae8ce (patch)
tree1e041678de8c08ca1830c2839f9a6da7f77b3531
parentMerge branch 'master' of git.bouncycastle.org:bc-csharp into pcl (diff)
parentUpdate .gitignore (diff)
downloadBouncyCastle.NET-ed25519-d49ba56148bf0d41080f9450b235807cfb1ae8ce.tar.xz
Merge branch 'master' of git.bouncycastle.org:bc-csharp into pcl
-rw-r--r--crypto/src/AssemblyInfo.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/crypto/src/AssemblyInfo.cs b/crypto/src/AssemblyInfo.cs
index cd951d282..239347365 100644
--- a/crypto/src/AssemblyInfo.cs
+++ b/crypto/src/AssemblyInfo.cs
@@ -84,7 +84,8 @@ using System.Runtime.InteropServices;
 
 internal class AssemblyInfo
 {
-    private static string version;
+    private static string version = null;
+
     public static string Version
     {
         get
@@ -93,13 +94,16 @@ internal class AssemblyInfo
             {
 #if PORTABLE
 #if NEW_REFLECTION
-                var ver = (AssemblyVersionAttribute)typeof(AssemblyInfo).GetTypeInfo().Assembly.GetCustomAttributes(typeof(AssemblyVersionAttribute)).FirstOrDefault();
+                var a = typeof(AssemblyInfo).GetTypeInfo().Assembly;
+                var c = a.GetCustomAttributes(typeof(AssemblyVersionAttribute));
 #else
-                var ver = (AssemblyVersionAttribute)typeof(AssemblyInfo).Assembly.GetCustomAttributes(typeof(AssemblyVersionAttribute), false).FirstOrDefault();
+                var a = typeof(AssemblyInfo).Assembly;
+                var c = a.GetCustomAttributes(typeof(AssemblyVersionAttribute), false);
 #endif
-                if (ver != null)
+                var v = (AssemblyVersionAttribute)c.FirstOrDefault();
+                if (v != null)
                 {
-                    version = ver.Version;
+                    version = v.Version;
                 }
 #else
                 version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
@@ -107,7 +111,9 @@ internal class AssemblyInfo
 
                 // if we're still here, then don't try again
                 if (version == null)
+                {
                     version = string.Empty;
+                }
             }
 
             return version;