try
{
// recover PDB filename for the model hovered over.
- int _mp = _modelFileNameMap.length - 1,
- mnumber = new Integer(mdlId).intValue() - 1;
- while (mnumber < _modelFileNameMap[_mp])
+ int mnumber = new Integer(mdlId).intValue() - 1;
+ if (_modelFileNameMap != null)
{
- _mp--;
+ int _mp = _modelFileNameMap.length - 1;
+
+ while (mnumber < _modelFileNameMap[_mp])
+ {
+ _mp--;
+ }
+ pdbfilename = modelFileNames[_mp];
}
- pdbfilename = modelFileNames[_mp];
- if (pdbfilename == null)
+ else
{
- pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
- .getAbsolutePath();
- }
+ if (mnumber >= 0 && mnumber < modelFileNames.length)
+ {
+ pdbfilename = modelFileNames[mnumber];
+ }
+ if (pdbfilename == null)
+ {
+ pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
+ .getAbsolutePath();
+ }
+ }
} catch (Exception e)
{
}