#6853: Check if object is undefined before checking property of it.
Merge pull request #6854 from openscholar/6853-broken_js

Check if object is undefined before checking property of it.