Skip to content

Commit a38c06e

Browse files
committed
BUG: skip exception when checking SpaceGroup origins
CreateCrystalFromCIF checks possible SpaceGroup origins with SpaceGroup::ChangeSpaceGroup() so we need to skip exception due to invalid SG symbol.
1 parent 1dadd87 commit a38c06e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

ObjCryst/ObjCryst/CIF.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,8 +1120,15 @@ Crystal* CreateCrystalFromCIF(CIF &cif,const bool verbose,const bool checkSymAsX
11201120
unsigned int bestscore=0;
11211121
for(vector<string>::const_iterator posOrig=origin_list.begin();posOrig!=origin_list.end();++posOrig)
11221122
{
1123-
// The origin extension may not make sense, but this will be handled internally in SpaceGroup
1124-
pCryst->GetSpaceGroup().ChangeSpaceGroup(hmorig+*posOrig);
1123+
// The origin extension may not make sense, so we need to watch for ObjCrystException
1124+
try
1125+
{
1126+
pCryst->GetSpaceGroup().ChangeSpaceGroup(hmorig+*posOrig);
1127+
}
1128+
catch(ObjCrystException e)
1129+
{
1130+
continue;
1131+
}
11251132

11261133
// If the symbol is the same as before, the origin probably was not understood - no need to test
11271134
if((posOrig!=origin_list.begin())&&(pCryst->GetSpaceGroup().GetName()==bestsymbol)) continue;

0 commit comments

Comments
 (0)