排除获取打开方式注册表项不存在的情况

This commit is contained in:
蓝点lilac
2021-01-01 19:30:16 +08:00
parent a1662448ff
commit c7ba07404a

View File

@@ -61,6 +61,7 @@ namespace ContextMenuManager.Controls
if(string.IsNullOrEmpty(defalutOpenMode)) continue;
using(RegistryKey openModeKey = root.OpenSubKey(defalutOpenMode))
{
if(openModeKey == null) continue;
string value1 = openModeKey.GetValue("FriendlyTypeName")?.ToString();
string value2 = openModeKey.GetValue("")?.ToString();
value1 = ResourceString.GetDirectString(value1);