Fix javascript error occuring when e is null/undefined
Merge pull request #863 from dpen2000/FixTypeError

Fix javascript error occuring when e is null/undefined