Pman.Tab.AdminOffice.bjs
[Pman.Admin] / Pman.Tab.AdminOffice.js
index ab343d7..d282c9b 100644 (file)
@@ -99,7 +99,12 @@ Pman.Tab.AdminOffice = new Roo.XComponent({
              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,