Refactors buildImage to use Promise; don't draw bad images

This commit is contained in:
Yury Delendik 2014-04-14 15:22:35 -05:00
parent 347a38a129
commit a00f854848
4 changed files with 42 additions and 35 deletions

View file

@ -912,7 +912,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
// heuristics that will allow not to store large data
var MAX_IMAGE_SIZE_TO_STORE = 8000000;
if ('data' in imageData &&
if (imageData && 'data' in imageData &&
imageData.data.length > MAX_IMAGE_SIZE_TO_STORE) {
pageProxy.cleanupAfterRender = true;
}