mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-22 11:42:25 +03:00
🔒 Add missing null checks
This commit is contained in:
parent
49eb262465
commit
ee735fe342
@ -350,9 +350,9 @@ const store = new Vuex.Store({
|
||||
}
|
||||
|
||||
axios.get(subConfigPath).then((response) => {
|
||||
const configContent = yaml.load(response.data);
|
||||
const configContent = yaml.load(response.data) || {};
|
||||
// Certain values must be inherited from root config
|
||||
const theme = configContent?.appConfig?.theme || rootConfig?.appConfig?.theme;
|
||||
const theme = configContent?.appConfig?.theme || rootConfig.appConfig?.theme || 'default';
|
||||
configContent.appConfig = rootConfig.appConfig;
|
||||
configContent.pages = rootConfig.pages;
|
||||
configContent.appConfig.theme = theme;
|
||||
|
@ -27,8 +27,10 @@ class HeaderAuth {
|
||||
return new Promise((resolve, reject) => {
|
||||
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
|
||||
axios.get(`${baseUrl}${serviceEndpoints.getUser}`).then((response) => {
|
||||
if (!response.data || response.data.errorMsg) {
|
||||
reject(response.data.errorMsg || 'Error');
|
||||
if (!response.data) {
|
||||
reject(Error('Error, expected data nout returned'));
|
||||
} else if (response.data.errorMsg) {
|
||||
reject(response.data.errorMsg);
|
||||
} else {
|
||||
try {
|
||||
this.users.forEach((user) => {
|
||||
|
Loading…
Reference in New Issue
Block a user