Update focusCaretTracker.js

More error checking in onFocus()