Skip to content

TaskResultConverter causes an InvalidCastException (can't cast COM object to T) #4505

@Sergio0694

Description

@Sergio0694

Describe the bug

The TaskResultConverter returns DependencyProperty.UnsetValue in the fallback path.
This causes invalid cast exceptions downstream when trying to convert the object to some type.
The converter should just return null if no value is available.

Regression

No, always been like this.

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

This can be reproed in the MVVM Toolkit sample app.
Just open the "Async relay command" page and observe the crash.

Expected behavior

The converter should return null.

Screenshots

image

Help us help you

Yes, I'd like to be assigned to work on this item.

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions