1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) no method find on undefined planCategories

This commit is contained in:
Sylvain 2022-12-22 14:56:59 +01:00
parent 18e82c0151
commit 00d841e2c6

View File

@ -121,7 +121,7 @@ export const PlansList: React.FC<PlansListProps> = ({ onError, onPlanSelection,
* When called with a category ID, returns the requested plan-category
*/
const findCategory = (categoryId: number): PlanCategory => {
return planCategories.find(c => c.id === categoryId);
return planCategories?.find(c => c.id === categoryId);
};
/**