- editorJSON.setValue(JSON.stringify(result, null, "\t"));
- editorJSON.setOption("autoRefresh", true);
- dialog.modal('hide');
- $('#modal_show_instance').modal('show');
+
+ if(result['data'] !== undefined) {
+ editorJSON.setValue(JSON.stringify(result['data'], null, "\t"));
+ editorJSON.setOption("autoRefresh", true);
+ dialog.modal('hide');
+ $('#modal_show_instance').modal('show');
+ }
+ else{
+ dialog.modal('hide');
+ bootbox.alert("An error occurred while retrieving the information.");
+ }