-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Resource Manager fix for F# File Resources (Bugzilla 53515) #825
Conversation
This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request. |
if (prop != null) | ||
return (int)prop.GetValue(type); | ||
object value = type.GetFields().FirstOrDefault(p => p.Name == propertyName)?.GetValue(type) | ||
?? type.GetProperties().FirstOrDefault(p => p.Name == propertyName)?.GetValue(type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we prefer tabs over spaces. otherwise 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird -- I changed the Visual Studio option, but it seems Visual Studio loves its spaces.
Now that I think of it, memberName
is probably a better argument name than propertyName
.
Also, I'll be honest -- I wasn't able to get the solution running on my environment, so this request is a best guess rather than fully tested code. I believe it will solve my immediate issue though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- I wasn't able to get the solution running on my environment
ouch...
I'm building a nuget of this PR and will send it to you by email so you can test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@SpiegelSoft can you rebase this please ? thanks |
e35bcda
to
6e623cb
Compare
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change that one, then retest, and I'll merge
return (int)prop.GetValue(type); | ||
object value = type.GetFields().FirstOrDefault(p => p.Name == memberName)?.GetValue(type) | ||
?? type.GetProperties().FirstOrDefault(p => p.Name == memberName)?.GetValue(type); | ||
if (value != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a check to make sure the cast operation won't fail ? like:
if (value!=null && value is int)
In fact, if the value is an int, the null check is redundant. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't have merged the master in this PR, it makes everything messy. you should instead have rebased it on top of master.
The changes are ok, so 👍 once the PR is neat
OK -- shall I try to roll these commits back?
…On 7 April 2017 at 10:48, Stephane Delcroix ***@***.***> wrote:
***@***.**** approved this pull request.
you shouldn't have merged the master in this PR, it makes everything
messy. you should instead have rebased it on top of master.
The changes are ok, so 👍 once the PR is neat
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#825 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiDAKM-lgKD4ArAMQpzXPODZwD4ZR70ks5rtgZqgaJpZM4Miy3L>
.
--
*Rob Lyndon*
9258-8945-2998
Spotlight <http://www.spotlight.com/9258-8945-2998>
|
@SpiegelSoft the easiest thing to do if you're not comfortable with (if you want to keep the same pr, you'll need to rename this branch to something else, and then recreate the new one with the same name) |
01eff41
to
d2129c9
Compare
Description of Change
In F#, loading images from files causes a null reference exception.
Bugs Fixed
https://bugzilla.xamarin.com/show_bug.cgi?id=53515
API Changes
None
Behavioral Changes
None
PR Checklist