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

NullReferenceException fix in TiledDocument.ReadXml #11

Merged
merged 1 commit into from Dec 19, 2014

Conversation

Projects
None yet
2 participants
@eropple
Contributor

eropple commented Dec 18, 2014

Fixes NullReferenceException when a map is loaded via a process with a native entry point; Assembly.GetEntryAssembly() can return null, and then the rest of it explodes. You can check this out by running TiledSharp via the XNA Content Pipeline or another application that doesn't have a standard public static void Main entry point, such as MSTest (I think).

@marshallward

This comment has been minimized.

Show comment
Hide comment
@marshallward

marshallward Dec 19, 2014

Owner

Thanks, this is great. I did not realised that GetEntryAssembly could return a null. I am happy to merge this.

Rather than nest the entire dependency, maybe it would be better to just nest the asm and manifest sets, and otherwise set manifest to an empty String list when no assembly is available.

(I am happy to make this change, but it looks like you're in a better position to test it; I am mostly stuck in Linux platforms.)

Owner

marshallward commented Dec 19, 2014

Thanks, this is great. I did not realised that GetEntryAssembly could return a null. I am happy to merge this.

Rather than nest the entire dependency, maybe it would be better to just nest the asm and manifest sets, and otherwise set manifest to an empty String list when no assembly is available.

(I am happy to make this change, but it looks like you're in a better position to test it; I am mostly stuck in Linux platforms.)

marshallward added a commit that referenced this pull request Dec 19, 2014

Merge pull request #11 from eropple/bugfix/LoadXML-NRE
NullReferenceException fix in TiledDocument.ReadXml

@marshallward marshallward merged commit 2a31850 into marshallward:master Dec 19, 2014

@marshallward

This comment has been minimized.

Show comment
Hide comment
@marshallward

marshallward Dec 19, 2014

Owner

Actually, don't worry about it, I'll just move the other return statement as an else block.

Thanks again!

Owner

marshallward commented Dec 19, 2014

Actually, don't worry about it, I'll just move the other return statement as an else block.

Thanks again!

@eropple

This comment has been minimized.

Show comment
Hide comment
@eropple

eropple Dec 19, 2014

Contributor

Alrighty, I was about to go do it but if that works, that works. :) Thanks!

On Thu, Dec 18, 2014 at 8:29 PM, Marshall Ward notifications@github.com
wrote:

Actually, don't worry about it, I'll just move the other return statement
as an else block.

Thanks again!


Reply to this email directly or view it on GitHub
#11 (comment)
.

Ed Ropple
http://edcanhack.com

Twitter: https://twitter.com/edropple
Github: https://github.com/eropple

Contributor

eropple commented Dec 19, 2014

Alrighty, I was about to go do it but if that works, that works. :) Thanks!

On Thu, Dec 18, 2014 at 8:29 PM, Marshall Ward notifications@github.com
wrote:

Actually, don't worry about it, I'll just move the other return statement
as an else block.

Thanks again!


Reply to this email directly or view it on GitHub
#11 (comment)
.

Ed Ropple
http://edcanhack.com

Twitter: https://twitter.com/edropple
Github: https://github.com/eropple

@marshallward

This comment has been minimized.

Show comment
Hide comment
@marshallward

marshallward Dec 19, 2014

Owner

I just pushed a change to master, could you test it out and see if it works with unmanaged binaries? (When you get a chance, no hurry)

Owner

marshallward commented Dec 19, 2014

I just pushed a change to master, could you test it out and see if it works with unmanaged binaries? (When you get a chance, no hurry)

@eropple

This comment has been minimized.

Show comment
Hide comment
@eropple

eropple Dec 19, 2014

Contributor

Yeah, looks fine when invoked via devenv.

Contributor

eropple commented Dec 19, 2014

Yeah, looks fine when invoked via devenv.

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