Fix NPE if attribute statement is null