Fix NPE when attributes not available