Was checking the wrong thing for undefined

Change-Id: I11b813fe8708ef03db2f8b884b3766d8cbe887ce
This commit is contained in:
Trevor Parscal 2012-06-18 17:37:12 -07:00
parent cf1c033bff
commit 4ffc6fff60

View file

@ -101,7 +101,7 @@ ve.init.Target.onLoadError = function( response, text, exception ) {
ve.init.Target.onSave = function( response, status ) {
this.saving = false;
var data = response['ve-parsoid'];
if ( !response ) {
if ( !data ) {
this.emit( 'saveError', 'Invalid response from server' );
} else if ( data.result !== 'success' ) {
this.emit( 'saveError', 'Unsuccessful request: ' + data.result );