Fix crash when there are only unknown recipients
The code is taken from f363ac3cf5739311fc0585fd1853d3f35e1d103e