Protect against empty strings being passed as button labels for preinstall/preuninstall_alerts

This commit is contained in:
Greg Neagle
2015-07-04 12:53:17 -07:00
parent fd75be09fa
commit c92a0ba042

View File

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