فهرست منبع

handle error when HackmdEditor is not initialized

Yuki Takei 7 سال پیش
والد
کامیت
a5a5d088e8
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      resource/js/components/PageEditorByHackmd.jsx

+ 1 - 1
resource/js/components/PageEditorByHackmd.jsx

@@ -35,7 +35,7 @@ export default class PageEditorByHackmd extends React.PureComponent {
    */
   getMarkdown() {
     if (!this.state.isInitialized) {
-      throw new Error('HackmdEditor component has not initialized');
+      return Promise.reject(new Error('HackmdEditor component has not initialized'));
     }
 
     return this.refs.hackmdEditor.getValue()