反转链表题使用递归出现空指针异常

反转链表题使用递归出现空指针异常
class Solution {
ListNode res =new ListNode();
ListNode cur = res;
public ListNode reverseList(ListNode head) {
  if (head != null && head.next != null) {  reverseList(head.next); }
  cur.next = head;
  cur = cur.next;
  **if(cur != null&&cur.next != null){ cur.next = null;}**这段代码如果不加入cur !=null就会出现空指针异常不知道为啥
  return  res.next;
}
}
运行结果及报错内容
我的解答思路和尝试过的方法
**if(cur != null&&cur.next != null){ cur.next = null;}**这段代码如果不加入cur !=null就会出现空指针异常求解答

reverseList(head.next) 改为 return reverseList(head.next);