Skip to content

Commit 4ccf6b3

Browse files
committed
Plugins: Fix possible None object access
1 parent 8637180 commit 4ccf6b3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

plugins/folding.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,11 @@ class MdeShowFoldAllSectionsCommand(MdeTextCommand):
322322
"""
323323

324324
def run(self, edit):
325-
view = self.view
326-
view.window().run_command(
327-
"show_overlay", {"overlay": "command_palette", "text": "MarkdownEditing: Fold"}
328-
)
325+
window = self.view.window()
326+
if window:
327+
window.run_command(
328+
"show_overlay", {"overlay": "command_palette", "text": "MarkdownEditing: Fold"}
329+
)
329330

330331

331332
class MdeFoldAllSectionsCommand(MdeTextCommand):

0 commit comments

Comments
 (0)