Only "title" and "program" are required for AddUserTasks
authorCheng Zhao <zcbenz@gmail.com>
Mon, 17 Nov 2014 09:26:44 +0000 (17:26 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 17 Nov 2014 09:26:44 +0000 (17:26 +0800)
atom/browser/api/atom_api_app.cc

index 12668db..ce56c0d 100644 (file)
@@ -42,10 +42,12 @@ struct Converter<Browser::UserTask> {
     mate::Dictionary dict;
     if (!ConvertFromV8(isolate, val, &dict))
       return false;
-    return dict.Get("program", &(out->program)) &&
-           dict.Get("arguments", &(out->arguments)) &&
-           dict.Get("title", &(out->title)) &&
-           dict.Get("description", &(out->description));
+    if (!dict.Get("program", &(out->program)) ||
+        !dict.Get("title", &(out->title)))
+      return false;
+    dict.Get("arguments", &(out->arguments));
+    dict.Get("description", &(out->description));
+    return true;
   }
 };