File tree Expand file tree Collapse file tree
apps/web/src/stores/room-list-v3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 * Please see LICENSE files in the repository root for full details.
66 */
77
8+ import { logger } from "matrix-js-sdk/src/logger" ;
9+
810import { SettingLevel } from "../../settings/SettingLevel" ;
911import SettingsStore from "../../settings/SettingsStore" ;
1012import Modal from "../../Modal" ;
@@ -78,7 +80,10 @@ export async function createSection(): Promise<string | undefined> {
7880export async function editSection ( tag : string ) : Promise < void > {
7981 const sectionData = SettingsStore . getValue ( "RoomList.CustomSectionData" ) || { } ;
8082 const section = sectionData [ tag ] ;
81- if ( ! section ) return ;
83+ if ( ! section ) {
84+ logger . info ( "Unknown section tag, cannot edit section" , tag ) ;
85+ return ;
86+ }
8287
8388 const modal = Modal . createDialog ( CreateSectionDialog , { sectionToEdit : section . name } ) ;
8489
@@ -97,7 +102,10 @@ export async function editSection(tag: string): Promise<void> {
97102 */
98103export async function deleteSection ( tag : string ) : Promise < void > {
99104 const sectionData = SettingsStore . getValue ( "RoomList.CustomSectionData" ) ;
100- if ( ! sectionData [ tag ] ) return ;
105+ if ( ! sectionData [ tag ] ) {
106+ logger . info ( "Unknown section tag, cannot delete section" , tag ) ;
107+ return ;
108+ }
101109
102110 const modal = Modal . createDialog ( RemoveSectionDialog ) ;
103111 const [ shouldRemoveSection ] = await modal . finished ;
You can’t perform that action at this time.
0 commit comments