mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-19 16:14:39 +00: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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user