Skip to content

Commit

Permalink
trim space if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz committed Nov 15, 2023
1 parent 4fbab3c commit 43992ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onReceive(final Context context, Intent intent) {
@Override
public void onTaskSuccess(String data) {
ServerSchema model = httpInventory.setServerModel(serverName);
if(!model.getSerial().isEmpty()) {
if(!model.getSerial().trim().isEmpty()) {
data = data.replaceAll("<SSN>(.*)</SSN>","<SSN>" + model.getSerial() + "</SSN>");
}
httpInventory.sendInventory(data, model, new HttpInventory.OnTaskCompleted() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private void sendInventory() {
inventory.getXML(new InventoryTask.OnTaskCompleted() {
@Override
public void onTaskSuccess(String data) {
if(!model.getSerial().isEmpty()) {
if(!model.getSerial().trim().isEmpty()) {
data = data.replaceAll("<SSN>(.*)</SSN>","<SSN>" + model.getSerial() + "</SSN>");
}
httpInventory.sendInventory(data, model, new HttpInventory.OnTaskCompleted() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private void sendInventory(final Activity activity, final Home.Presenter present
inventoryTask.getXML(new InventoryTask.OnTaskCompleted() {
@Override
public void onTaskSuccess(String data) {
if(!model.getSerial().isEmpty()) {
if(!model.getSerial().trim().isEmpty()) {
data = data.replaceAll("<SSN>(.*)</SSN>","<SSN>" + model.getSerial() + "</SSN>");
}
httpInventory.sendInventory(data, model, new HttpInventory.OnTaskCompleted() {
Expand Down Expand Up @@ -176,4 +176,4 @@ public void onTaskError(Throwable error) {
}
});
}
}
}

0 comments on commit 43992ca

Please sign in to comment.