Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public SubstructureIdentifier(String id) {
* Create a new identifier based on a set of ranges.
*
* If ranges is empty, includes all residues.
* @param pdbId
* @param ranges
* @param pdbId a pdb id, can't be null
* @param ranges the ranges
*/
public SubstructureIdentifier(String pdbId, List<ResidueRange> ranges) {
this(new PdbId(pdbId), ranges);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public SubstructureIdentifier toCanonical() throws StructureException{
String path = url.getPath();
pdbId = guessPDBID(path.substring(path.lastIndexOf("/") + 1));
}
return new SubstructureIdentifier(new PdbId(pdbId), ranges);
return new SubstructureIdentifier((pdbId==null?(PdbId)null:new PdbId(pdbId)), ranges);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ public void finalizeStructure() {
@Override
public void initStructure(int totalNumBonds, int totalNumAtoms, int totalNumGroups,
int totalNumChains, int totalNumModels, String modelId) {
structure.setPdbId(new PdbId(modelId));
if (modelId != null) {
structure.setPdbId(new PdbId(modelId));
}
allAtoms = new Atom[totalNumAtoms];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ public PdbId getPdbId() {
*/
@Deprecated
public void setPdbId(String pdbId) {
if(pdbId == null) this.pdbId = null;
this.pdbId = new PdbId(pdbId);
if (pdbId == null)
this.pdbId = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you.

else
this.pdbId = new PdbId(pdbId);
}


Expand Down