Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Grechuhin <i.grechuhin@gmail.com>2017-02-16 13:23:21 +0300
committerSergey Yershov <syershov@maps.me>2017-02-16 14:57:01 +0300
commit3b310a71fc957d4955c55803ddec5a0350230a61 (patch)
tree17975661b51b76643e1bb3eed70b6c003b090cd9
parent91a5d7d6d7ecfc321428b235deb2c6315e2413bc (diff)
[xc-scheme] [ios] Fixed crash.beta-632
-rw-r--r--iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm29
1 files changed, 20 insertions, 9 deletions
diff --git a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm
index 2adca8d8c8..ca413abc26 100644
--- a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm
+++ b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm
@@ -177,15 +177,26 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) {
dateStyle:NSDateFormatterNoStyle
timeStyle:NSDateFormatterShortStyle];
}
- self.distanceLabel.text = info.targetDistance;
- self.distanceLegendLabel.text = info.targetUnits;
- NSMutableAttributedString * distance =
- [[NSMutableAttributedString alloc] initWithString:info.targetDistance
- attributes:routingNumberAttributes];
- [distance
- appendAttributedString:[[NSAttributedString alloc] initWithString:info.targetUnits
- attributes:routingLegendAttributes]];
- self.distanceWithLegendLabel.attributedText = distance;
+ NSString * targetDistance = info.targetDistance;
+ NSMutableAttributedString * distance;
+ if (targetDistance)
+ {
+ self.distanceLabel.text = targetDistance;
+ distance = [[NSMutableAttributedString alloc] initWithString:targetDistance
+ attributes:routingNumberAttributes];
+ }
+
+ NSString * targetUnits = info.targetUnits;
+ if (targetUnits)
+ {
+ self.distanceLegendLabel.text = targetUnits;
+ if (distance)
+ {
+ [distance appendAttributedString:[[NSAttributedString alloc] initWithString:targetUnits
+ attributes:routingLegendAttributes]];
+ self.distanceWithLegendLabel.attributedText = distance;
+ }
+ }
NSString * currentSpeed = info.speed ?: @"0";
self.speedLabel.text = currentSpeed;