--fixed for CRM-12018

added condition to check if no membership is selected.