|
@@ -37,12 +37,12 @@ const ProjectChooser = createReactClass({
|
|
|
let org = this.getOrganization();
|
|
|
let projects = org.projects;
|
|
|
let tasks = TodoList.TASKS.filter(
|
|
|
- task_inst => task_inst.task == this.props.location.query.task
|
|
|
+ task_inst => task_inst.task === this.props.location.query.task
|
|
|
);
|
|
|
|
|
|
if (projects.length === 0) {
|
|
|
browserHistory.push(`/organizations/${org.slug}/projects/new/`);
|
|
|
- } else if (projects.length === 1 && tasks.length === 1) {
|
|
|
+ } else if (projects.length === 1 && tasks && tasks.length === 1) {
|
|
|
let project = projects[0];
|
|
|
browserHistory.push(`/${org.slug}/${project.slug}/${tasks[0].location}`);
|
|
|
}
|
|
@@ -56,7 +56,7 @@ const ProjectChooser = createReactClass({
|
|
|
|
|
|
// Expect onboarding=1 and task=<task id> parameters and task.featureLocation == 'project'
|
|
|
// TODO throw up report dialog if not true
|
|
|
- if (task.featureLocation != 'project') {
|
|
|
+ if (!task || task.featureLocation !== 'project') {
|
|
|
throw new Error('User arrived on project chooser without a valid task id.');
|
|
|
}
|
|
|
return (
|