Skip to content

Commit

Permalink
added check empty for safety reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroX-DG authored and Rokt33r committed Apr 24, 2019
1 parent 48bb9d3 commit 156a2c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions browser/components/MarkdownPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,8 @@ export default class MarkdownPreview extends React.Component {
const href = e.target.getAttribute('href')
const linkHash = href.split('/').pop()

if (!href) return

const regexNoteInternalLink = /main.html#(.+)/
if (regexNoteInternalLink.test(linkHash)) {
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])
Expand Down

0 comments on commit 156a2c6

Please sign in to comment.