Commit 2a51a216 by Apple

Fixed crash issues

parent 850235c5
...@@ -10,11 +10,11 @@ public class AppConfig { ...@@ -10,11 +10,11 @@ public class AppConfig {
public static final String DOMAIN_PRODUCTION = "https://ven01199.service-now.com/"; public static final String DOMAIN_PRODUCTION = "https://ven01199.service-now.com/";
public static final String DOMAIN_TEST = "https://ven01199.service-now.com/"; public static final String DOMAIN_TEST = "https://ven01199.service-now.com/";
public static final String LOGIN_CLIENT_ID_PRODUCTION = "ac0dd3408c1031006907010c2cc6ef6d"; public static final String LOGIN_CLIENT_ID_PRODUCTION = "d958eb06b0f3830093781f441d59febc";
public static final String LOGIN_CLIENT_SECRET_PRODUCTION = "oklj6znxv3o9jmyn2mlp"; public static final String LOGIN_CLIENT_SECRET_PRODUCTION = "krD*!O}1.8";
public static final String LOGIN_CLIENT_ID_TEST = "ac0dd3408c1031006907010c2cc6ef6d"; public static final String LOGIN_CLIENT_ID_TEST = "d958eb06b0f3830093781f441d59febc";
public static final String LOGIN_CLIENT_SECRET_TEST = "dh85bcz3vx4dvgqys610"; public static final String LOGIN_CLIENT_SECRET_TEST = "krD*!O}1.8";
/** /**
* Web services urls * Web services urls
......
...@@ -116,7 +116,7 @@ public class CatalogueVariableApiManager { ...@@ -116,7 +116,7 @@ public class CatalogueVariableApiManager {
CatalogueVariable catalogueVariable = catalogueVariableResponse.getVariables().get(i); CatalogueVariable catalogueVariable = catalogueVariableResponse.getVariables().get(i);
JSONObject catalogueVariableJsonObject = catalogueVariableJsonArray.getJSONObject(i); JSONObject catalogueVariableJsonObject = catalogueVariableJsonArray.getJSONObject(i);
catalogueVariable.parseJson(catalogueVariableJsonObject); catalogueVariable.parseJson(catalogueVariableJsonObject);
if(!catalogueVariable.getVariableChoiceList().isEmpty()) { if(catalogueVariable.getVariableChoiceList() !=null && !catalogueVariable.getVariableChoiceList().isEmpty()) {
Collections.sort(catalogueVariable.getVariableChoiceList(), new Comparator<VariableChoice>() { Collections.sort(catalogueVariable.getVariableChoiceList(), new Comparator<VariableChoice>() {
@Override @Override
public int compare(VariableChoice lhs, VariableChoice rhs) { public int compare(VariableChoice lhs, VariableChoice rhs) {
......
...@@ -270,7 +270,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -270,7 +270,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
for (int i = 0; i < completeCatalogueVariableList.size(); i++) { for (int i = 0; i < completeCatalogueVariableList.size(); i++) {
CatalogueVariable catalogueVariable = completeCatalogueVariableList.get(i); CatalogueVariable catalogueVariable = completeCatalogueVariableList.get(i);
if(!catalogueVariable.getVariableChoiceList().isEmpty()) { if( catalogueVariable.getVariableChoiceList()!=null && !catalogueVariable.getVariableChoiceList().isEmpty()) {
VariableChoiceManager.handleGetVariableChoice(catalogueVariable.getId(), catalogueVariable VariableChoiceManager.handleGetVariableChoice(catalogueVariable.getId(), catalogueVariable
.getVariableChoiceList()); .getVariableChoiceList());
} }
...@@ -279,6 +279,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -279,6 +279,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
/*Get all recently saved all items because we need local id of each item for save UiPolicyAction with respect to UiPolicyItem*/ /*Get all recently saved all items because we need local id of each item for save UiPolicyAction with respect to UiPolicyItem*/
List<UiPolicyItem> localUiPolicyItemList = UiPolicyItemManager.getAllUiPolicyItems(mCatalogueItem.getId()); List<UiPolicyItem> localUiPolicyItemList = UiPolicyItemManager.getAllUiPolicyItems(mCatalogueItem.getId());
if(catalogueVariableResponse !=null &&catalogueVariableResponse.getUiPolicy() !=null && catalogueVariableResponse.getUiPolicy().size()>0){
for (int i = 0; i < catalogueVariableResponse.getUiPolicy().size(); i++) { for (int i = 0; i < catalogueVariableResponse.getUiPolicy().size(); i++) {
UiPolicyItem uiPolicyItem = catalogueVariableResponse.getUiPolicy().get(i); UiPolicyItem uiPolicyItem = catalogueVariableResponse.getUiPolicy().get(i);
for(int j = 0; j < localUiPolicyItemList.size(); j++) { for(int j = 0; j < localUiPolicyItemList.size(); j++) {
...@@ -289,6 +290,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -289,6 +290,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
} }
} }
for (int i = 0; i < localUiPolicyItemList.size(); i++) { for (int i = 0; i < localUiPolicyItemList.size(); i++) {
UiPolicyItem uiPolicyItem = localUiPolicyItemList.get(i); UiPolicyItem uiPolicyItem = localUiPolicyItemList.get(i);
/*Save UiPolicyAction in local DB*/ /*Save UiPolicyAction in local DB*/
...@@ -297,7 +299,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -297,7 +299,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
setPartialCondition(uiPolicyItem); setPartialCondition(uiPolicyItem);
} }
} }}
@Override @Override
public void onFailApiCall() { public void onFailApiCall() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment