getActiveShell() sometimes returns null
This commit fixes #434.