Null check correction

When the nativeCanvas was not defined we had an error on Chrome