enthought/envisage — pull request #44 by robmcmullen (2014-02-07 19:07:37+00:00)
Title: Fixes degenerate case where no layout is specified in create_window

As a newbie, I didn't specify a layout for the a window I created using TaskApplication.create_window. When I called Application.exit(), I get the following exception:

```
Traceback (most recent call last):
File "/data/home/rob/src/enthought/envisage/envisage/ui/tasks/tasks_application.py", line 247, in exit
self._prepare_exit()
File "/data/home/rob/src/enthought/envisage/envisage/ui/tasks/tasks_application.py", line 303, in _prepare_exit
self._save_state()
File "/data/home/rob/src/enthought/envisage/envisage/ui/tasks/tasks_application.py", line 351, in _save_state
window_layouts = [ w.get_window_layout() for w in self.windows ]
File "/data/home/rob/src/enthought/pyface/pyface/tasks/task_window.py", line 306, in get_window_layout
size_state=self.size_state)
AttributeError: 'TaskWindow' object has no attribute 'size_state'
```

But when I specify an empty layout, e.g.

```
window = self.create_window(layout=TaskWindowLayout())
```

it works fine. Admittedly it's a degenerate case, but this patch adds an empty layout if the layout argument is None.