Should line be changed to something like ``if 'icon' in dict``?  Because if the icon isn't actually in there, this will error, no?