Pman.Tab.AdminOffice.bjs
[Pman.Admin] / Pman.Tab.AdminOffice.js
index ab343d7..59d9971 100644 (file)
@@ -99,8 +99,13 @@ Pman.Tab.AdminOffice = new Roo.XComponent({
              if (!_this.dialog) {
               return;
              }
-             var cdata = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data;
-             _dialog.show( { 
+             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;
+             _this.dialog.show( { 
                  id : 0 ,
                  company_name : cdata.name,
                  company_id : cdata.id,