Skip to content

Commit

Permalink
Merge pull request #980 from ubyssey/new-video-fix
Browse files Browse the repository at this point in the history
fixed error when creating new video
  • Loading branch information
keeganland authored Aug 4, 2020
2 parents 59a23a9 + 378bdb0 commit 9180658
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import * as Form from '../Form'

export default function VideoForm(props) {
let youtubeRegex = /(https?:\/\/)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)\/(watch\?v=|embed\/|v\/|.+\?v=)?([A-Za-z0-9\-=_]{11})/;
let match = props.listItem.url.match(youtubeRegex);
let youtubeVideoID = match[match.length - 1];
let match = '';
let youtubeVideoID = '';
if(props.listItem.url != undefined) {
match = props.listItem.url.match(youtubeRegex);
youtubeVideoID = match[match.length - 1];
}
return (
<Form.Container>

Expand Down

0 comments on commit 9180658

Please sign in to comment.