Added safety check for empty pendingSessions
Created by: ErikLarsson82
Running pendingSessions.shift() on an empty array makes no sense, so safety check added
Created by: ErikLarsson82
Running pendingSessions.shift() on an empty array makes no sense, so safety check added