avatar: Check the icon is valid before using it

This fixes a crash when the icon isn't found.
11 jobs for avatar-icon in 16 minutes and 32 seconds (queued for 1 second)
Status Name Job ID Coverage
  Build
passed api-visibility #819630

00:00:31

passed build-debian-clang #819632

00:03:00

passed build-debian-gcc #819631

00:02:10

passed build-fedora-gcc #819633

00:06:38

passed build-flatpak #819634
flatpak

00:01:11

passed build-flatpak-glade #819635
flatpak

00:03:19

 
  Test+Docs
passed build-gtkdoc #819636

00:02:08

passed unit-test #819637

00:04:36

44.2%
 
  Package
passed package-debian-buster #819638

00:02:43

 
  Test Package
passed autopkgtest-debian-buster-package #819639

00:02:31

passed lintian-debian-buster-package #819640

00:00:52