End-of-file gives null when it runs for "RunSelectedTextOrLineAction".
It is fixed by null checking.