Skip to content

Commit e4adfa1

Browse files
committed
Avoiding an NPE in mmtf reader
1 parent 4a3209c commit e4adfa1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ public void finalizeStructure() {
129129
for(Chain modelChain : modelChainMap.values()){
130130
structure.addChain(modelChain, i);
131131
String sequence = chainSequenceMap.get(modelChain.getId());
132+
if (sequence == null) {
133+
logger.warn("Sequence is null for chain with asym_id {}. Most likely the chain is non-polymeric. Will not add seqres groups for it.", modelChain.getId());
134+
continue;
135+
}
132136
MmtfUtils.addSeqRes(modelChain, sequence);
133137
}
134138
}

0 commit comments

Comments
 (0)