From: amwaterhouse Date: Fri, 7 Jul 2006 12:56:13 +0000 (+0000) Subject: Check row.annotations is not null X-Git-Tag: Release_2_1~316 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f69f430dcc4205b54192407a16f828469c42b659;hp=9ae26a7c4ce0bbc58c5ed5ad4371164a5fa80a66;p=jalview.git Check row.annotations is not null --- diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 71f51ea..614498c 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -467,6 +467,9 @@ public class AnnotationPanel column++; } + if(column>=row.annotations.length) + column = row.annotations.length-1; + x += av.charWidth; if (row.hasIcons) @@ -511,8 +514,8 @@ public class AnnotationPanel case 'E': g.setColor(SHEET_COLOUR); - if (row.annotations.length > endRes - && row.annotations[endRes].secondaryStructure != 'E') + if (row.annotations[endRes] ==null + || row.annotations[endRes].secondaryStructure != 'E') { g.fillRect(lastSSX, y + 4 + iconOffset, x - lastSSX - 4, 7);