Adding a null check on the playlist

Some unit tests were failing when selectedPlaylist.segments was
undefined.