Be more defensive in parameter checking.
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
* Shows a task in the #task-details div.
|
||||
*/
|
||||
function task_open(task_id, project_url) {
|
||||
if (task_id === undefined) {
|
||||
if (console) console.log("task_open(undefined) called.");
|
||||
if (task_id === undefined || project_url === undefined) {
|
||||
if (console) console.log("task_open(", task_id, project_url, ") called.");
|
||||
return;
|
||||
}
|
||||
console.log('before anything');
|
||||
|
||||
$('#task-list').find('a').removeClass('active');
|
||||
$('#task-' + task_id).addClass('active');
|
||||
@@ -29,9 +28,13 @@ function task_open(task_id, project_url) {
|
||||
* Create a task and show it in the #task-details div.
|
||||
*/
|
||||
function task_create(shot_id, project_url, task_type) {
|
||||
if (shot_id === undefined || project_url === undefined || task_type === undefined) {
|
||||
if (console) console.log("task_create(", shot_id, project_url, task_type, ") called.");
|
||||
return;
|
||||
}
|
||||
var base_url = '/attract/' + project_url + '/tasks/create';
|
||||
|
||||
if (task_type != undefined) {
|
||||
if (task_type) {
|
||||
base_url += '/' + task_type;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user