webgl: Add correct error handling to BufferSubData

From the WebGL spec:

> If data is null then an INVALID_VALUE error is generated.
This commit is contained in:
Emilio Cobos Álvarez 2015-12-07 18:03:31 +01:00
parent 89b65f3a02
commit a14b605c8e

View file

@ -417,7 +417,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
let data = match data {
Some(data) => data,
None => return,
None => return self.webgl_error(InvalidValue),
};
if offset < 0 {
return self.webgl_error(InvalidValue);