Added if-statement around possible undefined value.

On initial load, $history.activeIndex might be -1.  If it is, currentHistoryEntry will be undefined.
Merge pull request #190 from MarkMYoung/patch-1

Added if-statement around possible undefined value.