Skip to content

Commit 222a8ae

Browse files
committed
throw exception if residue type cannot be resolved
1 parent 4d1b305 commit 222a8ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public void setGroupInfo(String groupName, int groupNumber,
214214
char singleLetterCode, int sequenceIndexId, int secStructType) {
215215
// Get the polymer type
216216
ResidueType residueType = ResidueType.getResidueTypeFromString(chemCompType);
217+
if (residueType == null)
218+
throw new IllegalStateException("Couldn't resolve residue type for "+ chemCompType);
219+
217220
int polymerType = getGroupTypIndicator(residueType.polymerType);
218221
switch (polymerType) {
219222
case 1:

0 commit comments

Comments
 (0)