From c92a0ba0425bacfac4975d6e74ef7cc04df49fb2 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Sat, 4 Jul 2015 12:53:17 -0700 Subject: [PATCH] Protect against empty strings being passed as button labels for preinstall/preuninstall_alerts --- .../Managed Software Center/MSCMainWindowController.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/apps/Managed Software Center/Managed Software Center/MSCMainWindowController.py b/code/apps/Managed Software Center/Managed Software Center/MSCMainWindowController.py index 9f1410c7..c3c4ce08 100644 --- a/code/apps/Managed Software Center/Managed Software Center/MSCMainWindowController.py +++ b/code/apps/Managed Software Center/Managed Software Center/MSCMainWindowController.py @@ -932,10 +932,10 @@ class MSCMainWindowController(NSWindowController): defaultOKLabel = NSLocalizedString(u'OK', u'Pre Install Uninstall OK Label') defaultCancelLabel = NSLocalizedString(u'Cancel', u'Pre Install Uninstall Cancel Label') - alertTitle = dict.get('alert_title', defaultAlertTitle) + alertTitle = dict.get('alert_title') or defaultAlertTitle # shouldn't be an empty string alertDetail = dict.get('alert_detail', defaultAlertDetail) - OKLabel = dict.get('ok_label', defaultOKLabel) - cancelLabel = dict.get('cancel_label', defaultCancelLabel) + OKLabel = dict.get('ok_label') or defaultOKLabel # can't be an empty string + cancelLabel = dict.get('cancel_label') or defaultCancelLabel # can't be an empty string # show the alert sheet self.window().makeKeyAndOrderFront_(self)