Index: trunk/psLib/src/math/psMinimizePowell.c
===================================================================
--- trunk/psLib/src/math/psMinimizePowell.c	(revision 28580)
+++ trunk/psLib/src/math/psMinimizePowell.c	(revision 28634)
@@ -83,12 +83,12 @@
 f(param + b * line) < f(param + c * line)
 a < b < c
- 
+
 Algorithm:
- 
+
 XXX completely ad hoc:
 start with the user-supplied starting parameter and
 call that b.  Calculate a/c as a fractional amount smaller/larger than b.
 Repeat this process until a local minimum is found.
- 
+
 XXX: new algorithm:
 start at x=0, expand in one direction until the function
@@ -96,5 +96,5 @@
 increases, or x is too large.  If thst does not work, expand in the other
 direction.
- 
+
 XXX: output bracket vector should be an input as well.
 *****************************************************************************/
@@ -335,5 +335,5 @@
 along that vector and returns the offset along that vector at which the
 minimum is determined.
- 
+
 XXX: This routine is not very efficient in terms of total evaluations of the
 function.
@@ -491,5 +491,5 @@
 points at which the function is varied are in the argument "coords" which is
 a psArray of psVectors: each vector represents a different coordinate.
- 
+
 XXX: We do not use Brent's method.
  *****************************************************************************/
@@ -707,5 +707,5 @@
 This routine is to be used with the psMinimizeChi2Powell() function below.
 and the psMinimizePowell() function above.
- 
+
 The basic idea is calculate chi-squared for a set of params/coords/errors.
 This functions uses global variables to receive the function pointer, the
@@ -762,5 +762,5 @@
 This routine must minimize the chi-squared match of a set of data points and
 values for a possibly multi-dimensional function.
- 
+
 The basic idea is to use the psMinimizePowell() function defined above.  In
 order to do so, we defined above a function myPowellChi2Func() which takes
@@ -789,5 +789,6 @@
     newCoords->data[coords->n + 2] = &model;
 
-    bool success = psMinimizePowell(min, params, constraint->paramMask, newCoords, myPowellChi2Func);
+    bool success = psMinimizePowell(min, params, constraint ? constraint->paramMask : NULL,
+                                    newCoords, myPowellChi2Func);
 
     newCoords->data[coords->n - 1] = NULL; // We can't free the array with a function pointer on it
