Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ - (LinesMeasurements)getLinesForAttributedString:(facebook::react::AttributedStr

CGFloat baseline = [layoutManager locationForGlyphAtIndex:range.location].y;
auto line = LineMeasurement{
std::string([renderedString UTF8String]),
std::string(
[renderedString UTF8String] != nullptr ? [renderedString UTF8String] : ""),
rect,
overallRect.size.height - baseline,
font.capHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ @implementation UIView (ColorOverlays)

- (void)setBackgroundColorWithColorString:(NSString *)colorString
{
UIColor *color = [UIView UIColorFromHexString:std::string([colorString UTF8String])];
const char *colorUTF8 = [colorString UTF8String];
UIColor *color = [UIView UIColorFromHexString:std::string(colorUTF8 != nullptr ? colorUTF8 : "")];
self.backgroundColor = color;
}

Expand All @@ -23,7 +24,8 @@ - (void)addColorOverlays:(const NSArray *)overlayColors
id colorString = [overlayColors objectAtIndex:i];
CGRect rect = CGRectMake(viewBounds.origin.x + width * i, viewBounds.origin.y, width, viewBounds.size.height);
UIView *overlayView = [[UIView alloc] initWithFrame:rect];
UIColor *color = [UIView UIColorFromHexString:std::string([colorString UTF8String])];
const char *colorUTF8 = [colorString UTF8String];
UIColor *color = [UIView UIColorFromHexString:std::string(colorUTF8 != nullptr ? colorUTF8 : "")];
overlayView.backgroundColor = color;
[self addSubview:overlayView];
}
Expand Down
Loading