Changeset 5868


Ignore:
Timestamp:
03/29/11 15:43:16 (11 years ago)
Author:
epitzer
Message:

Prevent NullReferenceException when opening incompatible problem (#852)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs

    r5866 r5868  
    378378        ISwarmUpdater updater = Problem.Operators.OfType<ISwarmUpdater>().FirstOrDefault();
    379379        SwarmUpdaterParameter.ValidValues.Clear();
    380         SwarmUpdaterParameter.ValidValues.Add(updater);
    381         SwarmUpdaterParameter.Value = updater;
     380        if (updater != null) {
     381          SwarmUpdaterParameter.ValidValues.Add(updater);
     382          SwarmUpdaterParameter.Value = updater;
     383        }
    382384      }
    383385    }
Note: See TracChangeset for help on using the changeset viewer.