Skip to content

Commit

Permalink
Prevent a null pointer exception if leader is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Nov 16, 2023
1 parent d9a842c commit 14c2ca3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions catalogues/gent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ NAME=gent
TYPE_PARAMS="--marcVersion GENT --alephseq"
# MARC_DIR=${BASE_INPUT_DIR}/gent/marc/2020-05-27
# MASK=*.export
MARC_DIR=${BASE_INPUT_DIR}/gent/marc/2021-01-02
MASK=rug01.backup*
# MARC_DIR=${BASE_INPUT_DIR}/gent/marc/2021-01-02
# MASK=rug01.backup*
MASK=rug01.backup.2023-11-11.gz

. ./common-script
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ private void processContent(MarcReader reader, String fileName) {
if (bibliographicRecord != null)
processor.processRecord(bibliographicRecord, recordNumber);
} catch(Exception e) {
logger.log(Level.SEVERE, "start", e);
logger.log(Level.SEVERE, "Problem occured at processor.processRecord()", e);
e.printStackTrace();
}

if (recordNumber % 100000 == 0 && processor.getParameters().doLog())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public List<String> search(String path, String query) {

public List<String> select(MarcSpec selector) {
List<String> results = new ArrayList<>();
if (selector.getFieldTag().equals("LDR")) {
if (selector.getFieldTag().equals("LDR") && leader != null && StringUtils.isNotEmpty(leader.getContent())) {
if (selector.hasRangeSelector()) {
results.add(selector.selectRange(leader.getContent()));
} else {
Expand Down

0 comments on commit 14c2ca3

Please sign in to comment.