title: Value of registry key is returned as null even though it has a value
body: <p>i'm trying to get the value of registry key and compare it afterwards with a specific value if it matches this value. Unfortunately my method return a "null" value and i don't know why.</p>
  
  <pre><code>if (HelperRegistry.RegistryKeyValueExists("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Office\\Outlook\\Addins\\Connect to Outlook.AddinModule", "FriendlyName", "Connect to Outlook"))
  {
     OutputHandler.ColorCMDOutput("Do this", ConsoleColor.Green);
  }
  else
  {
      OutputHandler.ColorCMDOutput("Do that", ConsoleColor.Red);
  }
  
  
  static public bool RegistryKeyValueExists(string keyName, string valueName, string valueToBeTested)
  {
      try
      {
          using (RegistryKey key = Registry.LocalMachine.OpenSubKey(keyName + "\\" + valueName))
              if (key != null)
              {
                  Object o = key.GetValue("FriendlyName");
                  if (o != null)
                  {
                      string test = Convert.ToString(o);
                      if (test == valueToBeTested)
                      {
                          return true;
                      }
                  }
              }
          return false;
      }
      catch
      {
          return false;
      }
  }
  </code></pre>