bars = ids.map((id) => this.get_bar(id)).filter(bar => bar !== undefined);
With this filter we will not get an error if result of get_bar(id) is undefined
Same with get_task(task_id) (dependency arrows doesn't show because result of get_task is undefined): Dependency also has a strict comparison and if id is a number then the passed task_id could be a string (I use a numeric id to work with events from the database) and task.id could be a number
However, I don't think this is the correct way to go about it. In #393, I've enforced string based IDs (though users can pass in integers that will be converted).
I think the problem is in the filter in the get_bars function
https://github.com/frappe/gantt/blob/ea6259adceff6e7032d0abd4dcf87ff278251bee/src/index.js#L973C3-L977C4
Type of id can be String and type of bar.task.id is Number. We can:
Also i added filter to this line https://github.com/frappe/gantt/blob/ea6259adceff6e7032d0abd4dcf87ff278251bee/src/index.js#L782
bars = ids.map((id) => this.get_bar(id)).filter(bar => bar !== undefined);
With this filter we will not get an error if result of get_bar(id) is undefined
Same with get_task(task_id) (dependency arrows doesn't show because result of get_task is undefined): Dependency also has a strict comparison and if id is a number then the passed task_id could be a string (I use a numeric id to work with events from the database) and task.id could be a number