Skip to content

Replace !! operators with idiomatic Kotlin null handling (#57076)#57076

Open
Abbondanzo wants to merge 1 commit into
facebook:mainfrom
Abbondanzo:export-D107525522
Open

Replace !! operators with idiomatic Kotlin null handling (#57076)#57076
Abbondanzo wants to merge 1 commit into
facebook:mainfrom
Abbondanzo:export-D107525522

Conversation

@Abbondanzo
Copy link
Copy Markdown
Contributor

@Abbondanzo Abbondanzo commented Jun 4, 2026

Summary:

Replace all non-null assertion operators (!!) with idiomatic Kotlin alternatives following code review feedback.

Use checkNotNull() for validation, safe call operators (?.) with early returns, and local variables to eliminate repeated null assertions. Also adopt Kotlin stdlib helpers like isNullOrEmpty() and AndroidX KTX extensions (isNotEmpty(), isEmpty(), toDrawable()) for cleaner, more type-safe code.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D107525522

@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 Jun 4, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 4, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 4, 2026

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

Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

)

Summary:

Replace all non-null assertion operators (`!!`) with idiomatic Kotlin alternatives following code review feedback.

Use `checkNotNull()` for validation, safe call operators (`?.`) with early returns, and local variables to eliminate repeated null assertions. Also adopt Kotlin stdlib helpers like `isNullOrEmpty()` and AndroidX KTX extensions (`isNotEmpty()`, `isEmpty()`, `toDrawable()`) for cleaner, more type-safe code.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D107525522
@meta-codesync meta-codesync Bot changed the title Replace !! operators with idiomatic Kotlin null handling Replace !! operators with idiomatic Kotlin null handling (#57076) Jun 5, 2026
@Abbondanzo Abbondanzo force-pushed the export-D107525522 branch from 43c0b3f to 5b8af55 Compare June 5, 2026 19:03
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 meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants