Skip to content

Commit

Permalink
Merge pull request #286 from junaidbhura/fix/undefined-classifai-erro…
Browse files Browse the repository at this point in the history
…r-meta

Fix: Undefined ClassifAI Error Meta
  • Loading branch information
jeffpaul authored Jun 7, 2021
2 parents ea6e203 + 5b576c0 commit d6dfdb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subscribe( () => {

if ( saveHappened && false === wp.data.select( 'core/editor' ).isSavingPost() && false === showingNotice ) {
const meta = select( 'core/editor' ).getCurrentPostAttribute( 'meta' );
if ( meta._classifai_error ) {
if ( meta && meta._classifai_error ) {
showingNotice = true;
const error = JSON.parse( meta._classifai_error );
dispatch( 'core/notices' ).createErrorNotice( `Failed to classify content with the IBM Watson NLU API. Error: ${ error.code } - ${ error.message }` );
Expand Down

0 comments on commit d6dfdb8

Please sign in to comment.