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

Better error for Texture2D.FromStream when graphics device is null. #5049

Closed
Beng89 opened this issue Jul 31, 2016 · 0 comments
Closed

Better error for Texture2D.FromStream when graphics device is null. #5049

Beng89 opened this issue Jul 31, 2016 · 0 comments

Comments

@Beng89
Copy link

Beng89 commented Jul 31, 2016

I was recently working on loading textures with Texture2D.FromStream and kept getting the following error:

"This image format is not supported"

After fighting with this for about 30 minutes, I realized that the GraphicsDevice I was passing to the method as an argument was unintentionally null. The error that I received above was less than helpful when debugging this problem. Perhaps a better error could be throw when a null GraphicsDevice is provided (such as a NullReferenceException or an ArgumentException).

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

No branches or pull requests

1 participant