Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

[TextureView] Implicit operators raising Exceptions #162

Closed
KarimLUCCIN opened this issue Sep 14, 2013 · 1 comment
Closed

[TextureView] Implicit operators raising Exceptions #162

KarimLUCCIN opened this issue Sep 14, 2013 · 1 comment
Labels

Comments

@KarimLUCCIN
Copy link

In SharpDX.Toolkit.Graphics.TextureView, there are implicit operators for ShaderResourceView and RenderTargetView.

They are defined as:
public static implicit operator ShaderResourceView(TextureView view)
{
return view.View as ShaderResourceView;
}

But should be:
public static implicit operator ShaderResourceView(TextureView view)
{
return view == null ? null : view.View as ShaderResourceView;
}

Not doing so raises exceptions when an implicit conversion is done on a null resource (trying to convert a null TextureView into a function expecting a ShaderResourceView

@ArtiomCiumac
Copy link
Contributor

Fixed.

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

No branches or pull requests

2 participants