Check For Null Before Modifying Linked List

We were attempting to alter the "->next->prev" pointer in a linked
list without verifying that "->next" was not null. Add a check
before we start messing with the pointer.