Skip to content

Commit

Permalink
Added not-null checks in Projects class
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Dec 29, 2014
1 parent 0ffc6ee commit 121f819
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -10,6 +10,7 @@
import org.jboss.forge.addon.resource.Resource;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UISelection;
import org.jboss.forge.furnace.util.Assert;

/**
* Helper class for {@link Project} objects
Expand All @@ -31,6 +32,7 @@ public static Project getSelectedProject(ProjectFactory projectFactory, UIContex
*/
public static Project getSelectedProject(ProjectFactory projectFactory, UISelection<?> selection)
{
Assert.notNull(projectFactory, "Project Factory cannot be null");
Project project = null;
if (!selection.isEmpty() && selection.get() instanceof Resource)
{
Expand All @@ -45,6 +47,7 @@ public static Project getSelectedProject(ProjectFactory projectFactory, UISelect
*/
public static boolean containsProject(ProjectFactory projectFactory, UIContext context)
{
Assert.notNull(projectFactory, "Project Factory cannot be null");
UISelection<?> selection = context.getInitialSelection();
if (!selection.isEmpty() && selection.get() instanceof Resource)
{
Expand Down

0 comments on commit 121f819

Please sign in to comment.