From 822ee0479afcc500c72f16b7fa972dc99c8bf5d5 Mon Sep 17 00:00:00 2001 From: kiramt Date: Wed, 8 Nov 2017 07:59:44 +0000 Subject: [PATCH] JAL-2674 Added missing null check --- src/jalview/datamodel/HiddenColumns.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/jalview/datamodel/HiddenColumns.java b/src/jalview/datamodel/HiddenColumns.java index 399e083..da91f7b 100644 --- a/src/jalview/datamodel/HiddenColumns.java +++ b/src/jalview/datamodel/HiddenColumns.java @@ -907,16 +907,19 @@ public class HiddenColumns try { LOCK.writeLock().lock(); - Iterator it = hiddenColumns.iterator(); - while (it.hasNext()) + if (hiddenColumns != null) { - int[] region = it.next(); - for (int j = region[0]; j < region[1] + 1; j++) + Iterator it = hiddenColumns.iterator(); + while (it.hasNext()) { - sel.addElement(j); + int[] region = it.next(); + for (int j = region[0]; j < region[1] + 1; j++) + { + sel.addElement(j); + } } + hiddenColumns = null; } - hiddenColumns = null; } finally { LOCK.writeLock().unlock(); -- 1.7.10.2