Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

This PR backports the fix from PR #32660 to the release/10.0.1xx-sr1 branch. The fix addresses a NullReferenceException that occurs when TimePicker.Time is set to null.

Since TimePicker now supports nullable Time values, the casts in the TimePropertyChanged event handler need to be nullable to match the TimeChangedEventArgs constructor signature.

Changes Made

  • Updated TimePropertyChanged method in src/Controls/src/Core/TimePicker/TimePicker.cs
  • Changed casts from (TimeSpan)oldValue and (TimeSpan)newValue to (TimeSpan?)oldValue and (TimeSpan?)newValue

Issues Fixed

Fixes crash when TimePicker.Time is set to null by throwing a NullReferenceException.

Original prompt

can you create a pr with the same changes as this pr #32660 ? Ive set this base branch to a different branch because i want to backport this fix


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@PureWeen
Copy link
Member

@copilot can you try again please?

I think github was down and having issues

@PureWeen
Copy link
Member

@copilot please try again

Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot please try again

Done! Applied the nullable cast fix from PR #32660. The change makes TimePropertyChanged cast to TimeSpan? instead of TimeSpan to prevent NullReferenceException when TimePicker.Time is set to null. (commit c3d0cb4)

Copilot AI changed the title [WIP] Backport fix from PR 32660 Fix crash when TimePicker.Time is set to null (backport from PR #32660) Nov 18, 2025
@PureWeen PureWeen marked this pull request as ready for review November 19, 2025 05:51
Copilot AI review requested due to automatic review settings November 19, 2025 05:51
@PureWeen PureWeen merged commit b5d476f into release/10.0.1xx-sr1 Nov 19, 2025
4 of 5 checks passed
@PureWeen PureWeen deleted the copilot/backport-fix-from-pr-32660 branch November 19, 2025 05:51
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Nov 19, 2025
Copy link
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 backports a critical bug fix from PR #32660 that resolves a NullReferenceException crash when TimePicker.Time is set to null. The fix updates the type casting in the TimePropertyChanged event handler to match the nullable signature of the TimeChangedEventArgs constructor.

Key Changes

  • Updated casts in TimePropertyChanged method from non-nullable (TimeSpan) to nullable (TimeSpan?) for both oldValue and newValue parameters

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 join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants