]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix parameter detection in capturePage.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 23 Apr 2014 01:09:28 +0000 (09:09 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 23 Apr 2014 01:09:28 +0000 (09:09 +0800)
atom/browser/api/atom_api_window.cc

index cb65ce9293160b1f71919a9c54b685ebecef1d48..f3ad61bcd1e4f5cf393cf02c89b189533cb21485 100644 (file)
@@ -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;
   }