if (!_this.dialog) {
return;
}
- var cdata = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data;
+ var sd = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected();
+ if (!sd) {
+ Roo.MessageBox.alert("Error", "Select an company to add an office to");
+ return;
+ }
+ var cdata = sd.data;
_dialog.show( {
id : 0 ,
company_name : cdata.name,