From: kiramt Date: Wed, 8 Nov 2017 07:59:44 +0000 (+0000) Subject: JAL-2674 Added missing null check X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=822ee0479afcc500c72f16b7fa972dc99c8bf5d5;p=jalview.git JAL-2674 Added missing null check --- 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();