mirror of https://github.com/lissy93/dashy
🔒 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) => {
|
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
|
// 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.appConfig = rootConfig.appConfig;
|
||||||
configContent.pages = rootConfig.pages;
|
configContent.pages = rootConfig.pages;
|
||||||
configContent.appConfig.theme = theme;
|
configContent.appConfig.theme = theme;
|
||||||
|
|
|
@ -27,8 +27,10 @@ class HeaderAuth {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
|
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
|
||||||
axios.get(`${baseUrl}${serviceEndpoints.getUser}`).then((response) => {
|
axios.get(`${baseUrl}${serviceEndpoints.getUser}`).then((response) => {
|
||||||
if (!response.data || response.data.errorMsg) {
|
if (!response.data) {
|
||||||
reject(response.data.errorMsg || 'Error');
|
reject(Error('Error, expected data nout returned'));
|
||||||
|
} else if (response.data.errorMsg) {
|
||||||
|
reject(response.data.errorMsg);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
this.users.forEach((user) => {
|
this.users.forEach((user) => {
|
||||||
|
|
Loading…
Reference in New Issue