Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XABT] Create separate compress assemblies task. #9637

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Dec 19, 2024

No description provided.

{
var value = item.GetMetadata (name);

if (string.IsNullOrWhiteSpace (value))
return defaultValue;

return value;
return (T?)Convert.ChangeType (value, typeof (T));
Copy link
Contributor

Choose a reason for hiding this comment

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

This throws https://learn.microsoft.com/en-us/dotnet/api/system.convert.changetype?view=net-9.0. We should handle that case? and return the default.

Copy link
Contributor Author

@jpobst jpobst Jan 6, 2025

Choose a reason for hiding this comment

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

I think this only throws if the input cannot be converted to the requested type, like say you passed in "tru" and T is bool.

Passing in an invalid input is a bug that should be fixed, and it feels like we should indeed throw an exception here rather than silently swallow the error and return the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants