From: Jim Procter Date: Mon, 8 Jul 2024 10:13:59 +0000 (+0100) Subject: JAL-4440 defensive checks for Jmol/Jalview binding issue X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f22c3f1a9d0debc880383f442d99f28b09b40cc7;p=jalview.git JAL-4440 defensive checks for Jmol/Jalview binding issue --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 93a5633..1c19854 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -785,6 +785,17 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } else { + PDBEntry ppe=getPdbEntry(pe); + if (ppe==null) { + Console.warn("Please report under JAL-4440: Unexpected null entry for PDBEntry for a structure (for structure "+fileName+")"); + + continue; + } + if (ppe.getFile()==null) + { + Console.warn("Please report under JAL-4440: Unexpected null entry for file that we just tried to load into Jmol: pdbEntry: "+ppe.toString()+"(for structure "+fileName+")"); + continue; + } File fl = new File(getPdbEntry(pe).getFile()); matches = fl.equals(new File(fileName)); if (matches)