Fix the capturePage method.

This commit is contained in:
Cheng Zhao 2014-04-23 11:39:40 +08:00
parent f6cca0df48
commit babfbe40d2

View file

@ -316,7 +316,7 @@ void Window::CapturePage(mate::Arguments* args) {
gfx::Rect rect;
base::Callback<void(v8::Handle<v8::Value>)> callback;
if (!(args->Length() == 1 && args->GetNext(&callback)) ||
if (!(args->Length() == 1 && args->GetNext(&callback)) &&
!(args->Length() == 2 && args->GetNext(&rect)
&& args->GetNext(&callback))) {
args->ThrowError();