FIx crash in substring

This commit is contained in:
PavelRatushny 2017-07-25 10:42:16 +03:00
parent 351218faf4
commit 3b21c41372

View file

@ -216,7 +216,11 @@ public class SendPoiDialogFragment extends DialogFragment {
modifiedItemsOutOfLimit += quantity; modifiedItemsOutOfLimit += quantity;
if (!stringModifiedIfExceeded) { if (!stringModifiedIfExceeded) {
if (pos == 0) { if (pos == 0) {
if (comment.length() - action.length() - 3 >= 0) {
comment = comment.substring(0, comment.length() - action.length() - 3).concat("; "); comment = comment.substring(0, comment.length() - action.length() - 3).concat("; ");
} else {
comment = comment.substring(0, comment.length() - action.length() - 1).concat("; ");
}
} else { } else {
comment = comment.substring(0, comment.length() - 2).concat("; "); comment = comment.substring(0, comment.length() - 2).concat("; ");
} }