فهرست منبع

Fix optional chaining for file extension retrieval in EditorSwitch

GitOrigin-RevId: 9aeee2f856c4f4dadc38affecc06179b61267af0
Domagoj Kriskovic 7 ماه پیش
والد
کامیت
f078929b25
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      services/web/frontend/js/features/source-editor/components/editor-switch.tsx

+ 1 - 1
services/web/frontend/js/features/source-editor/components/editor-switch.tsx

@@ -17,7 +17,7 @@ function EditorSwitch() {
   const richTextAvailable = openDocName
     ? isVisualEditorAvailable(openDocName)
     : false
-  const extension = getFileExtension(openDocName || '')
+  const extension = getFileExtension(openDocName || '') ?? ''
 
   const handleChange = useCallback(
     (event: ChangeEvent<HTMLInputElement>) => {