Devi mostrare TUTTO il codice, anche quello che chiama la funzione in cui hai l'errore.

E devi indicare quali parametri passi ...