Error Deleting memberships
The error is happening in the deleteMembership function, and the error says: you're trying to execute the method "delete" on an empty (i.e. null) object. The object that is "null" is expected to be a membership object. 

That suggests that the code might have been running two copies in parallel - e.g. perhaps you clicked twice on the delete button (would not be difficult, since you're trying to do a mass delete on a lot of memberships).