Prevent user from change their role and losing admin access to the project

Actual behaviour:
When a user is the only Project Manager and he change his role, this project can no longer be edited by anyone other than an administrator.

Expected behaviour:
Prevent the user to change his role when it’s the only Project Manager.

Steps to reproduce:
Create a project
Go to Configure this project
Permissions
Change user’s role to Member or Viewer
Press F5