title: I'm implementing a deque using singly linked list in Java. My addLast() is not working
body: <p>I'm implementing a deque using singly linked list in Java. My <code>addFirst()</code> function is working fine, but <code>addLast()</code> is not working.</p>
  
  <p>Whenever I call <code>addLast()</code>, I got the following error message:</p>
  
  <blockquote>
    <p>java.lang.NullPointerException</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/tAxXZ.png" alt="This is my function implementations"></p>