Skip to content

Commit

Permalink
Check for null base modification sets when drawing expanded insertion…
Browse files Browse the repository at this point in the history
…s. See issue #1303
  • Loading branch information
jrobinso committed Dec 1, 2023
1 parent 7bcb418 commit e92ea91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/broad/igv/sam/BaseRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static void drawExpandedInsertions(InsertionMarker insertionMarker,

// Compute the start and end of the expanded insertion in pixels
int pixelStart = (int) ((insertion.getStart() - origin) / locScale);
int pixelEnd = (int) (pixelStart + insertion.getLength() / locScale);
int pixelEnd = (int) (pixelStart + insertion.getLength() / locScale);

// Skip if insertion is out of clipping rectangle -- this probably shouldn't happen
if (pixelEnd < rect.x || pixelStart > rect.getMaxX()) {
Expand Down Expand Up @@ -150,7 +150,9 @@ public static void drawExpandedInsertions(InsertionMarker insertionMarker,

if (colorOption.isBaseMod()) {
List<BaseModificationSet> baseModificationSets = alignment.getBaseModificationSets();
BaseModificationRenderer.drawBlock(origin, locScale, rect, g, renderOptions, baseModificationSets, insertion);
if (baseModificationSets != null) {
BaseModificationRenderer.drawBlock(origin, locScale, rect, g, renderOptions, baseModificationSets, insertion);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public static void drawModifications(

public static void drawBlock(double bpStart, double locScale, Rectangle rowRect, Graphics g, AlignmentTrack.RenderOptions renderOptions, List<BaseModificationSet> baseModificationSets, AlignmentBlock block) {

if(baseModificationSets == null) return;

AlignmentTrack.ColorOption colorOption = renderOptions.getColorOption();
BaseModficationFilter filter = renderOptions.getBasemodFilter();
float threshold = renderOptions.getBasemodThreshold();
Expand Down

0 comments on commit e92ea91

Please sign in to comment.