From 93c481aadf43084b994fae3a8f3e160e12ee76e5 Mon Sep 17 00:00:00 2001 From: taro Date: Wed, 19 Feb 2025 02:17:09 -0300 Subject: [PATCH] handle possible error case --- src/stores/user.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stores/user.js b/src/stores/user.js index 7f9d8a54..992e6e06 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -250,6 +250,11 @@ export const useUserStore = defineStore('user', () => { try { const userData = await api.get('VnUsers/getCurrentUserData'); + if (!userData?.data) { + console.error('GET VnUsers/getCurrentUserData returned invalid data', userData); + return; + } + if (userType === 'user') mainUser.value = userData.data; else supplantedUser.value = userData.data; } catch (error) {