eganwu 3 лет назад
Родитель
Сommit
a110288e7b
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      src/custom/restcontroller/ClientUserInfo.java

+ 10 - 2
src/custom/restcontroller/ClientUserInfo.java

@@ -40,7 +40,11 @@ public class ClientUserInfo extends UserInfo {
     }
 
     public long getEnterpriseId() throws YosException {
-        return getEnterpriseRow().getLong("sys_enterpriseid");
+        Row row = getEnterpriseRow();
+        if(row==null||row.isEmpty()){
+            return 0;
+        }
+        return row.getLong("sys_enterpriseid");
     }
 
     public Row getEnterprise_HrRow() throws YosException {
@@ -64,7 +68,11 @@ public class ClientUserInfo extends UserInfo {
     }
 
     public long getAgentsId() throws YosException {
-        return getAgentsRow().getLong("sa_agentsid");
+        Row row = getAgentsRow();
+        if (row==null||row.isEmpty()) {
+            return 0;
+        }
+        return row.getLong("sa_agentsid");
     }
 
     public  boolean isSaler() throws YosException {