Windows: conditionally set tray icon state
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Nov 2010 05:07:36 +0000 (00:07 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sat, 20 Nov 2010 03:18:17 +0000 (19:18 -0800)
If the checkbox IDC_TRAYICON is not present in the dialog,
do not attempt to use its value as a setting for
Config_SetTrayIconFlag().

FIXES 128591

Change-Id: Iebee8198ec25e1841f6fa49b9850a16329f2cbdd
Reviewed-on: http://gerrit.openafs.org/3331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

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)
       {