mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-10 02:16:06 +01:00
fix (fatal): edge case causing fatal issue
I've seen the case where someone ran out of disk with a corrupted config file which gave the following fatal error in the login screen: Uncaught TypeError: Cannot read properties of null (reading 'map') with a stacktrace pointing to: ctrl_form.js:22:63 this fixes the assumptions on the config file so as to not trigger the fatal error but head to the nicer error cases where it would say: Internal Error: There is nothing here. which is much nicer for end users than "Cannot read properties of null"
This commit is contained in:
parent
2914443789
commit
8303ae54f0
1 changed files with 2 additions and 2 deletions
|
|
@ -19,8 +19,8 @@ import backend$ from "./model_backend.js";
|
|||
import { setCurrentBackend, getCurrentBackend, getURLParams } from "./ctrl_form_state.js";
|
||||
|
||||
const connections$ = config$.pipe(
|
||||
rxjs.map(({ connections = [], auth = [] }) => connections.map((conn) => {
|
||||
conn.middleware = auth.indexOf(conn.label) >= 0;
|
||||
rxjs.map(({ connections, auth }) => (connections || []).map((conn) => {
|
||||
conn.middleware = (auth || []).indexOf(conn.label) >= 0;
|
||||
return conn;
|
||||
})),
|
||||
rxjs.shareReplay(1),
|
||||
|
|
|
|||
Loading…
Reference in a new issue