ISelection currentSelection = HandlerUtil.getCurrentSelection(event);\r
TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(currentSelection);\r
if (treeNodeOfSelection != null && treeNodeOfSelection.getValue() instanceof SingleRead) {\r
-// SingleRead singleRead = (SingleRead)treeNodeOfSelection.getValue();\r
-// singleRead.get\r
//TODO Can the parent node (containing the cut positions) be extracted from SingleRead?\r
-\r
try {\r
- showPherogram(new PherogramComponentModel(AlignmentEditor.readPherogram(MediaUtils.getFirstMediaRepresentationPart(\r
- ((SingleRead)treeNodeOfSelection.getValue()).getPherogram()).getUri())));\r
+ SingleRead singleRead = (SingleRead)treeNodeOfSelection.getValue();\r
+ if (singleRead.getPherogram() == null) {\r
+ MessagingUtils.messageDialog("No pherogram available", this,\r
+ "The selected read does not have an associated pherogram.");\r
+ }\r
+ else {\r
+ showPherogram(new PherogramComponentModel(AlignmentEditor.readPherogram(\r
+ MediaUtils.getFirstMediaRepresentationPart(singleRead.getPherogram()).getUri())));\r
+ }\r
}\r
catch (Exception e) {\r
MessagingUtils.errorDialog("Error", null, e.getLocalizedMessage(), "eu.etaxonomy.taxeditor.editor", //TODO Is null a valid value here?\r