Changeset 2167


Ignore:
Timestamp:
Apr 19, 2006, 4:05:58 PM (17 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #193: Nullpointer exception when running an AutoDetectImporter? plugin

Location:
trunk/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/import/index.jsp

    r1945 r2167  
    153153    int pluginConfigurationId = Values.getInt(request.getParameter("pluginconfiguration_id"));
    154154   
    155     if (pluginDefinitionId == 0 || pluginConfigurationId == 0)
     155    if (pluginDefinitionId == -1 || pluginConfigurationId == -1)
    156156    {
    157157      // Auto-detect was selected
     
    181181    int pluginDefinitionId = Values.getInt(request.getParameter("plugindefinition_id"));
    182182    PluginDefinition plugin = null;
    183     if (pluginDefinitionId != 0)
     183    if (pluginDefinitionId != -1)
    184184    {
    185185      plugin = PluginDefinition.getById(dc, pluginDefinitionId);
     
    202202        plugin = plugins.entrySet().iterator().next().getKey();
    203203        List<PluginConfiguration> configList = plugins.get(plugin);
    204         if (configList.size() == 1)
    205         {
    206           // TODO - case when configList == 0
     204        if (configList != null && configList.size() > 1)
     205        {
     206          // Multiple configurations matches
     207          matches = configList.size();
     208        }
     209        else
     210        {
     211          // 0 or 1 configuration matched
     212          PluginConfiguration pc = null;
     213          if (configList != null && configList.size() == 1)
     214          {
     215            pc = configList.get(0);
     216          }
    207217          redirect = "../plugin/index.jsp?ID="+ID+
    208             "&cmd=NewJob&pluginconfiguration_id="+configList.get(0).getId()+
     218            "&cmd=NewJob" +
     219            (pc == null ? "" : "&pluginconfiguration_id="+ pc.getId()) +
    209220            "&plugindefinition_id="+plugin.getId()+
    210221            "&title="+request.getParameter("title")+
     
    215226            "&context_type="+context.getType().name();
    216227        }
    217         else
    218         {
    219           matches = configList.size();
    220         }
    221228      }
    222229      if (matches > 1)
  • trunk/www/include/scripts/plugin.js

    r1985 r2167  
    33  BioArray Software Environment (BASE) - http://base.thep.lu.se/
    44  Copyright (C) 2002-2004 Lao Saal, Carl Troein,
    5   Johan Vallon-Christersson, Jari Häkkinen, Nicklas Nordborg
     5  Johan Vallon-Christersson, Jari H?kkinen, Nicklas Nordborg
    66
    77  This file is part of BASE.
     
    3636  this.populateLists = function(pluginList, configurationList)
    3737  {
    38     pluginList[pluginList.length] = new Option('- auto detect -', 0);
     38    pluginList[pluginList.length] = new Option('- auto detect -', '-1');
    3939    var numAutodetecting = 0;
    4040    for (var i = 0; i < this.allPlugins.length; i++)
     
    4444      if (plugin.autodetection)
    4545      {
    46         option.text += ' '+String.fromCharCode(215); // 215 = × (multiplication sign)
     46        option.text += ' '+String.fromCharCode(215); // 215 = x (multiplication sign)
    4747        numAutodetecting++;
    4848      }
     
    6464      if (plugin.autodetection)
    6565      {
    66         list[list.length] = new Option('- auto detect -', 0);
     66        list[list.length] = new Option('- auto detect -', '-1');
    6767      }
    6868      for (var i = 0; i < plugin.configurations.length; i++)
     
    7474    else
    7575    {
    76       list[list.length] = new Option('- auto detect -', 0);
     76      list[list.length] = new Option('- auto detect -', '-1');
    7777    }
    7878  }
Note: See TracChangeset for help on using the changeset viewer.