Fix parameter detection in capturePage.
This commit is contained in:
parent
5037daadfb
commit
bccbc5e821
1 changed files with 3 additions and 4 deletions
|
@ -318,10 +318,9 @@ void Window::CapturePage(mate::Arguments* args) {
|
|||
gfx::Rect rect;
|
||||
base::Callback<void(v8::Handle<v8::Value>)> callback;
|
||||
|
||||
if ((args->Length() == 1 && !args->GetNext(&callback)) ||
|
||||
(args->Length() == 2 && !args->GetNext(&rect)
|
||||
&& !args->GetNext(&callback)) ||
|
||||
(args->Length() == 0)) {
|
||||
if (!(args->Length() == 1 && args->GetNext(&callback)) ||
|
||||
!(args->Length() == 2 && args->GetNext(&rect)
|
||||
&& args->GetNext(&callback))) {
|
||||
args->ThrowError();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue