Help with Fit

I am trying to do the following fit:

TGraphErrors g(fitLength,z,absx,zerr,xerr);
  TCanvas cd("cd","",0,0,500,500);

 I am running this over a large number of events. In some cases, I have:

  z[0] =  z[1] =........=z[6]

  when the fit is done over these arrays, i get the following error message:

 Error in <TDecompChol::Decompose()>: matrix not positive definite
 Error in <TDecompChol::Solve()>: Decomposition failed

is there a root function I can use which will help me skip the fitting step if a case like the above occurs ?
-thanks debdatta.