všechno zlé je k něčemu dobré

Etymology
lit. 'all that is bad is good for something'.

Proverb

 * 1) every cloud has a silver lining