IDEMPIERE-4105:fix out of bound exception when don't append "comment"

This commit is contained in:
hieplq 2019-11-14 21:34:17 +07:00
parent 03fe304d7e
commit b811cde27a
1 changed files with 6 additions and 3 deletions

View File

@ -71,8 +71,9 @@ public class PipoDictionaryService implements IDictionaryService {
if (versionSeparatorPos > 0) { if (versionSeparatorPos > 0) {
int dotPos = fileName.lastIndexOf("."); int dotPos = fileName.lastIndexOf(".");
if (dotPos > 0 && dotPos > versionSeparatorPos) { if (dotPos > 0 && dotPos > versionSeparatorPos) {
if (fileName.indexOf("_") != fileName.lastIndexOf("_")) int extraInfoIndex = fileName.indexOf("_", versionSeparatorPos + 6);
dotPos=fileName.lastIndexOf("_"); if (extraInfoIndex > 0)
dotPos=extraInfoIndex;
String version = fileName.substring(versionSeparatorPos+"2Pack_".length(), dotPos); String version = fileName.substring(versionSeparatorPos+"2Pack_".length(), dotPos);
if (version.split("[.]").length == 3) { if (version.split("[.]").length == 3) {
@ -123,7 +124,9 @@ public class PipoDictionaryService implements IDictionaryService {
try { try {
Trx.get(trxName, false).close(); Trx.get(trxName, false).close();
} catch (Exception e) {} } catch (Exception e) {}
adPackageImp.save(); // ignoring exceptions
if (adPackageImp != null)
adPackageImp.save(); // ignoring exceptions
if (adPackageImp != null && packIn != null) { if (adPackageImp != null && packIn != null) {
// Add the attachment to the packin for possible reprocessing // Add the attachment to the packin for possible reprocessing