#vulnerable code 
                              @Override
  public void process(ClusterEvent event) throws Exception
  {
    ClusterManager manager = event.getAttribute("clustermanager");
    if (manager == null)
    {
      throw new StageException("ClusterManager attribute value is null");
    }
    ClusterDataAccessor dataAccessor = manager.getDataAccessor();
    Map<String, ResourceGroup> resourceGroupMap = event
        .getAttribute(AttributeName.RESOURCE_GROUPS.toString());
    MessageSelectionStageOutput messageSelectionStageOutput = event
        .getAttribute(AttributeName.MESSAGES_SELECTED.toString());
    for (String resourceGroupName : resourceGroupMap.keySet())
    {
      ResourceGroup resourceGroup = resourceGroupMap.get(resourceGroupName);
      for (ResourceKey resource : resourceGroup.getResourceKeys())
      {
        List<Message> messages = messageSelectionStageOutput.getMessages(
            resourceGroupName, resource);
        sendMessages(dataAccessor, messages);
      }
    }
  } 
                            #location 14 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Override
  public void process(ClusterEvent event) throws Exception
  {
    ClusterManager manager = event.getAttribute("clustermanager");
    if (manager == null)
    {
      throw new StageException("ClusterManager attribute value is null");
    }
    ClusterDataAccessor dataAccessor = manager.getDataAccessor();
    Map<String, ResourceGroup> resourceGroupMap = event
        .getAttribute(AttributeName.RESOURCE_GROUPS.toString());
    if (resourceGroupMap == null)
    {
      throw new StageException("ResourceGroupMap attribute value is null");
    }
    MessageSelectionStageOutput messageSelectionStageOutput = event
        .getAttribute(AttributeName.MESSAGES_SELECTED.toString());
    for (String resourceGroupName : resourceGroupMap.keySet())
    {
      ResourceGroup resourceGroup = resourceGroupMap.get(resourceGroupName);
      for (ResourceKey resource : resourceGroup.getResourceKeys())
      {
        List<Message> messages = messageSelectionStageOutput.getMessages(
            resourceGroupName, resource);
        sendMessages(dataAccessor, messages);
      }
    }
  }