3 ms·
How come it doesn't return null here? I display an alert if WebGL isn't available.
by jlongster 14y ago
How come it doesn't return null here? I display an alert if WebGL isn't available.
- kevingadd 14y agoYou can get an exception from any canvas or WebGL API in cases where a driver is misbehaving (or, worst case, you have hit a browser bug). You gotta wrap that stuff in try/catch (at least the getContext call, as a minimum). I don't think this is spec compliant, but I've seen it in Firefox, Chrome and Opera under various configurations.