diff --git a/ui/dialogs/dialogs.ios.ts b/ui/dialogs/dialogs.ios.ts index 09b58101a..7e200cb79 100644 --- a/ui/dialogs/dialogs.ios.ts +++ b/ui/dialogs/dialogs.ios.ts @@ -403,10 +403,14 @@ function showUIAlertController(alertController: UIAlertController) { var lblColor = dialogsCommon.getLabelColor(); if (lblColor) { - var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, { [NSForegroundColorAttributeName]: lblColor.ios }); - alertController.setValueForKey(title, "attributedTitle"); - var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, { [NSForegroundColorAttributeName]: lblColor.ios }); - alertController.setValueForKey(message, "attributedMessage"); + if (alertController.title) { + var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, { [NSForegroundColorAttributeName]: lblColor.ios }); + alertController.setValueForKey(title, "attributedTitle"); + } + if (alertController.message) { + var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, { [NSForegroundColorAttributeName]: lblColor.ios }); + alertController.setValueForKey(message, "attributedMessage"); + } } viewController.presentModalViewControllerAnimated(alertController, true);