Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Commit

Permalink
Fix JS error when DOM element not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Schmitt authored and Joseph Schmitt committed May 9, 2017
1 parent 7313ed4 commit c28a761
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ mixins.manageState = {
function getViewSel (el) {
el = window.Dom7(el.target || el).parents('.view')
return (el.attr('id') !== '' && el.attr('id') !== null ? '#' + el.attr('id') : '') +
(el[0].classList.length > 0 ? '.' + el[0].classList.value.replace(/ /g, '.') : '')
(el.length && el[0].classList.length > 0 ? '.' +
el[0].classList.value.replace(/ /g, '.') : '');
}
function getViewUrl (el) {
let viewSel = getViewSel(el)
Expand Down

0 comments on commit c28a761

Please sign in to comment.