ㄧㄣㄏㄨㄛˋㄉㄜˊㄈㄨˊyīnhuò‑défú

因祸得福
  1. 遭遇災禍因此好處 受傷之後反而眾人關愛因禍得福」。

to profit from a disaster (idiom)​; some good comes out of a setback, It's an ill wind that blows nobody any good.