From 19b6a1b1c26488766bbbc3e4ec10f5e4a0229ccc Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 6 Jun 2016 16:48:43 -0400 Subject: [PATCH] Fixed out-of-range error. - Resolves VUFIND-1183. --- import/index_scripts/author.bsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/import/index_scripts/author.bsh b/import/index_scripts/author.bsh index c0cc4f1d1d9..bfe5f7cd12c 100644 --- a/import/index_scripts/author.bsh +++ b/import/index_scripts/author.bsh @@ -375,9 +375,9 @@ public String processInitials(String authorName) { if (name.length() > 0) { String initial = name.substring(0,1); // if there is a hyphenated name, use both initials - if (name.indexOf('-') > 0) { - int pos = name.indexOf('-'); - String extra = name.substring(pos+1,pos+2); + int pos = name.indexOf('-'); + if (pos > 0 && pos < name.length() - 1) { + String extra = name.substring(pos+1, pos+2); initial = initial + " " + extra; } result += " " + initial; -- GitLab