Sublime Forum

View.window() None even though a window is open

#1

Traceback (most recent call last):
File “./sublime_plugin.py”, line 195, in on_modified
File “./sublime_plugin.py”, line 154, in run_timed_function
File “./sublime_plugin.py”, line 194, in
File “./sassy_bunny.py”, line 94, in on_modified
File “./sassy_bunny.py”, line 117, in post_changes
AttributeError: ‘NoneType’ object has no attribute ‘folders’

When calling view.window().folders()

Printing out view.window() reveals it is None. This occurs intermittently and is resolved by closing the view (file) and reopening it.

Any ideas why this might be occurring?

0 Likes

#2

Where is “view” coming from? Are you holding on to a reference to a view that’s been closed or something?

0 Likes

#3

You can probably get away with just using sublime.active_window()

0 Likes