Skip to content

Fix crash when TimePicker.Time is set to null#32660

Merged
jfversluis merged 1 commit intodotnet:inflight/currentfrom
breyed:patch-1
Nov 18, 2025
Merged

Fix crash when TimePicker.Time is set to null#32660
jfversluis merged 1 commit intodotnet:inflight/currentfrom
breyed:patch-1

Conversation

@breyed
Copy link
Copy Markdown
Contributor

@breyed breyed commented Nov 17, 2025

Description of Change

Since TimePicker now supports nullable, the casts need to be nullable to match the TimeChangedEventArgs properties.

Issues Fixed

timeSpan.Time = null throws a NullReferenceException. (This PR is also the reporting issue.)

#32709

Copilot AI review requested due to automatic review settings November 17, 2025 00:24
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 17, 2025
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @@breyed! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a crash that occurs when setting TimePicker.Time to null by updating the type casts to nullable TimeSpan in the TimePropertyChanged event handler.

Key Changes:

  • Modified the casts in TimePropertyChanged from (TimeSpan) to (TimeSpan?) to properly handle nullable TimeSpan values

@jfversluis
Copy link
Copy Markdown
Member

jfversluis commented Nov 18, 2025

/azp run MAUI-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis
Copy link
Copy Markdown
Member

/rebase

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis
Copy link
Copy Markdown
Member

Awesome @breyed sorry we missed this! Thank you for contributing!

@jfversluis jfversluis changed the base branch from main to inflight/current November 18, 2025 15:45
@jfversluis
Copy link
Copy Markdown
Member

/rebase

Since TimePicker now supports nullable, the casts need to be nullable to match the TimeChangedEventArgs properties. Otherwise, `timeSpan.Time = null` throws a NullReferenceException.
@jfversluis jfversluis merged commit 55ec5ec into dotnet:inflight/current Nov 18, 2025
1 check passed
@PureWeen
Copy link
Copy Markdown
Member

/backport to release/10.0.1xx-sr1

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx-sr1 (link to workflow run)

@github-actions
Copy link
Copy Markdown
Contributor

@PureWeen backporting to release/10.0.1xx-sr1 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Patch format detection failed.
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

Copilot AI added a commit that referenced this pull request Nov 18, 2025
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Nov 19, 2025
… (#32715)

* Initial plan

* Fix crash when TimePicker.Time is set to null (backport from PR #32660)

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
evgenygunko pushed a commit to evgenygunko/CopyWordsDA that referenced this pull request Nov 26, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [Microsoft.Maui.Controls](https://github.com/dotnet/maui) | nuget | patch | `10.0.10` -> `10.0.11` |

---

### Release Notes

<details>
<summary>dotnet/maui (Microsoft.Maui.Controls)</summary>

### [`v10.0.11`](https://github.com/dotnet/maui/releases/tag/10.0.11): SR1.1

[Compare Source](dotnet/maui@10.0.10...10.0.11)

##### What's Changed

.NET MAUI 10.0.11 introduces significant improvements across all platforms with focus on quality, performance, and developer experience. This release includes 11 commits with various improvements, bug fixes, and enhancements.

##### .NET MAUI Product Fixes

##### Android

-   Fix content page title clipping on Android API < 30 with window insets compatibility by [@&#8203;Copilot](https://github.com/Copilot) in dotnet/maui#32738

    <details>
    <summary>🔧 Fixes</summary>

    -   [Shell content page title position incorrect/clipped](dotnet/maui#32526)

    </details>

##### Button

-   \[release/10.0.1xx-sr1] Removed Value property coercion in RadioButton by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32604

    <details>
    <summary>🔧 Fixes</summary>

    -   [Removed Value property coercion in RadioButton](dotnet/maui#32489)

    </details>

##### DateTimePicker

-   Fix crash when TimePicker.Time is set to null (backport from PR [#&#8203;32660](dotnet/maui#32660)) by [@&#8203;Copilot](https://github.com/Copilot) in dotnet/maui#32715

    <details>
    <summary>🔧 Fixes</summary>

    -   [Fix crash when TimePicker.Time is set to null](dotnet/maui#32660)

    </details>

##### Gestures

-   \[release/10.0.1xx-sr1] predictive back gesture support for Android 13+ by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32635

    <details>
    <summary>🔧 Fixes</summary>

    -   [predictive back gesture support for Android 13+](dotnet/maui#32461)

    </details>

##### Infrastructure

-   \[release/10.0.1xx-sr1] \[ci] Revert changes setting Creator by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32803

    <details>
    <summary>🔧 Fixes</summary>

    -   [\[ci\] Revert changes setting Creator](dotnet/maui#32743)

    </details>

##### Mediapicker

-   \[release/10.0.1xx-sr1] \[Android] Refactor selection limit handling in MediaPicker by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32628

    <details>
    <summary>🔧 Fixes</summary>

    -   [\[Android\] Refactor selection limit handling in MediaPicker](dotnet/maui#32571)

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

Labels

community ✨ Community Contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants