update null checks to use getKey method for #270