diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index ec73cc17d..a2cc45916 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -335,11 +335,19 @@ class CoursesNew extends Component { // this.props.history.push(this.props.current_user.first_category_url); // } // window.history.go(-1) - if(id===undefined){ - this.props.history.goBack() - }else{ - this.props.history.push(this.props.current_user.first_category_url); - } + try { + if(id===undefined){ + this.props.history.push("/"); + }else{ + if(this.props.current_user.first_category_url===undefined){ + this.props.history.push("/"); + }else{ + this.props.history.push(this.props.current_user.first_category_url); + } + } + }catch (e) { + this.props.history.push("/"); + } }