future proof findStore

This commit is contained in:
Vendicated 2025-02-17 01:59:54 +01:00
parent 1a0a70eb24
commit 3dc7e8e44a
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -423,7 +423,10 @@ export function findByCodeLazy(...code: CodeFilter) {
* Find a store by its displayName
*/
export function findStore(name: StoreNameFilter) {
const res: any = Flux.Store.getAll().find(filters.byStoreName(name));
const res = Flux.Store.getAll
? Flux.Store.getAll().find(filters.byStoreName(name))
: find(filters.byStoreName(name), { isIndirect: true });
if (!res)
handleModuleNotFound("findStore", name);
return res;