Home Download Buy Blog Forum Support

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

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

Postby namit on Thu Oct 11, 2012 1:49 pm

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 <lambda>
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?
namit
 
Posts: 1
Joined: Thu Oct 11, 2012 1:46 pm

Re: view.window() None even though a window is open.

Postby adzenith on Thu Oct 11, 2012 5:14 pm

Where is "view" coming from? Are you holding on to a reference to a view that's been closed or something?
adzenith
 
Posts: 1215
Joined: Mon Oct 19, 2009 9:12 pm

Re: view.window() None even though a window is open.

Postby sublimator on Fri Oct 12, 2012 10:35 am

You can probably get away with just using sublime.active_window()
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am


Return to Plugin Development

Who is online

Users browsing this forum: Google [Bot] and 9 guests