Given you have not shared which line, it would be difficult to tell which variable but if you DEBUG or atleast put the code in a file and see the exact line 32, you will figure there is a variable that is NULL and needs handling.
Add
isset()
checks around the null variables.
Refer:
PHP isset() Function[
^]