nie ma tego złego, co by na dobre nie wyszło

Etymology
lit. 'there wouldn't be this bad [thing], which wouldn't work out for the better'.

Phrase

 * 1)  every cloud has a silver lining