From 31a6da0676d095eec8e5db353e10caeae68821b3 Mon Sep 17 00:00:00 2001 From: Peter Staev Date: Tue, 2 Feb 2016 18:41:36 +0200 Subject: [PATCH] fix ios dialogs.action when message/title is null --- ui/dialogs/dialogs.ios.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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);