Windows: conditionally set tray icon state
[openafs.git] / src / WINNT / client_config / tab_general.cpp
index f50c120..4994c2b 100644 (file)
@@ -268,11 +268,12 @@ BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid)
    BOOL fLogonAuthent = IsDlgButtonChecked (hDlg, IDC_LOGON);
    if (fLogonAuthent != g.Configuration.fLogonAuthent)
       {
-          SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED);
+      SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED);
       g.Configuration.fLogonAuthent = fLogonAuthent;
       }
 
-   Config_SetTrayIconFlag (IsDlgButtonChecked (hDlg, IDC_TRAYICON));
+  if (GetDlgItem(hDlg, IDC_TRAYICON) != NULL)
+      Config_SetTrayIconFlag (IsDlgButtonChecked(hDlg, IDC_TRAYICON));
 
    if (g.fIsWinNT)
       {