Skip to content

Commit f4f2189

Browse files
himaoziaslushnikov
authored andcommitted
fix(page): fix page.screenshot method (#4786)
This patch fixes page.screenshot. so that it throws correct error message when options.clip.height===0
1 parent eb44e26 commit f4f2189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/Page.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ class Page extends EventEmitter {
879879
assert(typeof options.clip.width === 'number', 'Expected options.clip.width to be a number but found ' + (typeof options.clip.width));
880880
assert(typeof options.clip.height === 'number', 'Expected options.clip.height to be a number but found ' + (typeof options.clip.height));
881881
assert(options.clip.width !== 0, 'Expected options.clip.width not to be 0.');
882-
assert(options.clip.height !== 0, 'Expected options.clip.width not to be 0.');
882+
assert(options.clip.height !== 0, 'Expected options.clip.height not to be 0.');
883883
}
884884
return this._screenshotTaskQueue.postTask(this._screenshotTask.bind(this, screenshotType, options));
885885
}

0 commit comments

Comments
 (0)