From f22c3f1a9d0debc880383f442d99f28b09b40cc7 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 8 Jul 2024 11:13:59 +0100 Subject: [PATCH] JAL-4440 defensive checks for Jmol/Jalview binding issue --- src/jalview/ext/jmol/JalviewJmolBinding.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) -- 1.7.10.2