maqetta/maqetta — Issue #1879: Error while autosaving file:TypeError: Cannot call method 'getText' of undefined
Author: aerwin
Created: 2012-03-08 21:29:41+00:00
State: open
Labels: Priority Med, Review and Commenting

@JonFerraiolo @waynevicknair

It seems that when Maqetta does an autosave on a ReviewEditor, this exception shows up in the JavaScript console:

```preformatted
Error while autosaving file:TypeError: Cannot call method 'getText' of undefined
saveDirtyWorkbench.js:1437
forEacharray.js:283
Workbench._autoSaveWorkbench.js:1442
hitch
```

I did a little investigation to make sure my #1867 work didn't cause it, and it looks like `this.model` is undefined in the save function of `ModelEditor` (one of `ReviewEditor`'s ancestors).

```javascript
save: function () {
this.model.setText(this.getText());
this.inherited(arguments);
},
```

I don't think this really has any negative side effects since `ReviewEditor` is not saved in a classical sense and`'Workbench` catches the exception. But, someone who's worked on review stuff should think about this (e.g., is `ModelEditor` the right thing to override?, should `save` be overridden, etc.).