make a virtue of necessity

to manage to gain an advantage from something that you have to do and cannot avoid

Meaning

  1. to manage to gain an advantage from something that you have to do and cannot avoid