Fix astropy/astropy#2418 -- fix crash in smart_resolver when lookup fails