course completion: MDL-2631 Prevent error when no roles are available