Skip to content

Commit 7507955

Browse files
devvaannshabose
authored andcommitted
fix: remove optional chaining as its not supported
1 parent d392292 commit 7507955

File tree

1 file changed

+1
-1
lines changed
  • src/extensionsIntegrated/CustomSnippets

1 file changed

+1
-1
lines changed

src/extensionsIntegrated/CustomSnippets/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ define(function (require, exports, module) {
161161
* @returns {string|null} - The file extension or null if not available
162162
*/
163163
function getCurrentFileExtension(editor) {
164-
const filePath = editor.document?.file?.fullPath;
164+
const filePath = editor && editor.document && editor.document.file ? editor.document.file.fullPath : undefined;
165165
if (filePath) {
166166
return filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
167167
}

0 commit comments

Comments
 (0)