From 9135daf8d838bea18eecbc1f0d156539df3b80c9 Mon Sep 17 00:00:00 2001 From: Don Leckie Date: Tue, 28 Jan 2003 04:10:06 +0000 Subject: [PATCH] Fixed potential NullPointerException. git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1385 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/src/net/sourceforge/pmd/swingui/RulesTreeModel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pmd/src/net/sourceforge/pmd/swingui/RulesTreeModel.java b/pmd/src/net/sourceforge/pmd/swingui/RulesTreeModel.java index 6a40e8c9b3..bf83608852 100644 --- a/pmd/src/net/sourceforge/pmd/swingui/RulesTreeModel.java +++ b/pmd/src/net/sourceforge/pmd/swingui/RulesTreeModel.java @@ -12,6 +12,7 @@ import net.sourceforge.pmd.swingui.event.RulesTreeModelEvent; import net.sourceforge.pmd.swingui.event.RulesTreeModelEventListener; import javax.swing.tree.DefaultTreeModel; +import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Enumeration; @@ -169,6 +170,11 @@ class RulesTreeModel List ruleSetList = m_pmdDirectoryReturnedEventHandler.getRuleSetList(); + if (ruleSetList == null) + { + ruleSetList = new ArrayList(); + } + // // Sort the rule sets by name in ascending order. //