PTBR:
Bom o problema é estar na implementação da função ou no parâmetro da mesma.

Tem que debugar, mas segue o que Mart disse, poste o código inteiro, ou pelo menos partes do código que use esta função.


Eng (Google Translate):
Well the problem is to be in the implementation of the function or in the parameter of the same.

It has to debug, but follow what Mart said, post the whole code, or at least parts of the code that uses this function.