From 866d3014107fbe3fde7bd6fe89dd3d988cc09736 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Wed, 20 Oct 2021 10:37:56 +0200 Subject: [PATCH] fix(starred): demoted user wont get error when listing modules --- front/salix/components/home/home.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/front/salix/components/home/home.js b/front/salix/components/home/home.js index 74b43a12f..7f08b41b7 100644 --- a/front/salix/components/home/home.js +++ b/front/salix/components/home/home.js @@ -33,9 +33,11 @@ export default class Controller extends Component { if (!res.data.length) return; for (let starredModule of res.data) { - const module = this.modules.find(mod => mod.name === starredModule.moduleFk); - module.starred = true; - module.position = starredModule.position; + try { + const module = this.modules.find(mod => mod.name === starredModule.moduleFk); + module.starred = true; + module.position = starredModule.position; + } catch (error) {} } this.countModules(); });