generalmente stai usando un variabile che vale null. dovresti postare il codice relativo all'errore....