Skip to content

Fix RCTTextLayoutManager nullable conversion (#56547)#56547

Closed
fkgozali wants to merge 1 commit into
facebook:mainfrom
fkgozali:export-D101920741
Closed

Fix RCTTextLayoutManager nullable conversion (#56547)#56547
fkgozali wants to merge 1 commit into
facebook:mainfrom
fkgozali:export-D101920741

Conversation

@fkgozali
Copy link
Copy Markdown
Contributor

@fkgozali fkgozali commented Apr 22, 2026

Summary:

The original fix in RCTTextLayoutManager.mm used the pattern [obj UTF8String] != nullptr ? [obj UTF8String] : "", but Clang's null analysis still types the first operand as _Nullable, so -Wnullable-to-nonnull-conversion is still triggered as a hard error under Xcode 26.4. Switch to the local-variable pattern that was already used correctly for RNTMyNativeViewCommon.mm:

const char *renderedUTF8 = [renderedString UTF8String];
... std::string(renderedUTF8 != nullptr ? renderedUTF8 : "") ...

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101920741

@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 22, 2026

@fkgozali has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101920741.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 22, 2026
@fkgozali fkgozali force-pushed the export-D101920741 branch from 7294583 to 4c7b8bb Compare April 22, 2026 03:25
@meta-codesync meta-codesync Bot changed the title Fix RCTTextLayoutManager nullable conversion Fix RCTTextLayoutManager nullable conversion (#56547) Apr 22, 2026
@fkgozali fkgozali force-pushed the export-D101920741 branch from 4c7b8bb to 926050a Compare April 22, 2026 18:25
fkgozali added a commit to fkgozali/react-native that referenced this pull request Apr 22, 2026
Summary:

The original fix in `RCTTextLayoutManager.mm` used the pattern `[obj UTF8String] != nullptr ? [obj UTF8String] : ""`, but Clang's null analysis still types the first operand as `_Nullable`, so `-Wnullable-to-nonnull-conversion` is still triggered as a hard error under Xcode 26.4. Switch to the local-variable pattern that was already used correctly for `RNTMyNativeViewCommon.mm`:

```
const char *renderedUTF8 = [renderedString UTF8String];
... std::string(renderedUTF8 != nullptr ? renderedUTF8 : "") ...
```


Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101920741
fkgozali added a commit to fkgozali/react-native that referenced this pull request Apr 22, 2026
Summary:
Pull Request resolved: facebook#56547

The original fix in `RCTTextLayoutManager.mm` used the pattern `[obj UTF8String] != nullptr ? [obj UTF8String] : ""`, but Clang's null analysis still types the first operand as `_Nullable`, so `-Wnullable-to-nonnull-conversion` is still triggered as a hard error under Xcode 26.4. Switch to the local-variable pattern that was already used correctly for `RNTMyNativeViewCommon.mm`:

```
const char *renderedUTF8 = [renderedString UTF8String];
... std::string(renderedUTF8 != nullptr ? renderedUTF8 : "") ...
```

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101920741
@fkgozali fkgozali force-pushed the export-D101920741 branch from 926050a to 236e7d1 Compare April 22, 2026 18:28
fkgozali added a commit to fkgozali/react-native that referenced this pull request Apr 22, 2026
Summary:

The original fix in `RCTTextLayoutManager.mm` used the pattern `[obj UTF8String] != nullptr ? [obj UTF8String] : ""`, but Clang's null analysis still types the first operand as `_Nullable`, so `-Wnullable-to-nonnull-conversion` is still triggered as a hard error under Xcode 26.4. Switch to the local-variable pattern that was already used correctly for `RNTMyNativeViewCommon.mm`:

```
const char *renderedUTF8 = [renderedString UTF8String];
... std::string(renderedUTF8 != nullptr ? renderedUTF8 : "") ...
```


Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101920741
@fkgozali fkgozali force-pushed the export-D101920741 branch from 236e7d1 to fddf703 Compare April 22, 2026 18:29
Summary:
Pull Request resolved: facebook#56547

The original fix in `RCTTextLayoutManager.mm` used the pattern `[obj UTF8String] != nullptr ? [obj UTF8String] : ""`, but Clang's null analysis still types the first operand as `_Nullable`, so `-Wnullable-to-nonnull-conversion` is still triggered as a hard error under Xcode 26.4. Switch to the local-variable pattern that was already used correctly for `RNTMyNativeViewCommon.mm`:

```
const char *renderedUTF8 = [renderedString UTF8String];
... std::string(renderedUTF8 != nullptr ? renderedUTF8 : "") ...
```

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101920741
@fkgozali fkgozali force-pushed the export-D101920741 branch from fddf703 to f8beb94 Compare April 22, 2026 18:39
@meta-codesync meta-codesync Bot closed this in 98df9b1 Apr 22, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 22, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 22, 2026

This pull request has been merged in 98df9b1.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @fkgozali in 98df9b1

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants