Bug XXX Part 2 - Add null pointer check for caretFocusFrame