title: wp.data.select('meta') property undefined with Gutenberg for WordPress
body: <p>I use Gutenberg with WordPress and I would like to check some fields before the user publish his post.</p>
  <p>I would like to check if the <code>featured image</code>, the <code>title</code> and a simple <code>text field</code> in a meta-box are not empty.</p>
  <p>If a field is empty a notification is displayed and I locked the &quot;Publish&quot; button.</p>
  <p>For the moment all works fine with the <code>featured image</code> and the <code>title</code>. But when I'm trying to check is the text field in the meta-box is empty I got errors :</p>
  <pre><code>Uncaught TypeError: Cannot read property '_myprefix_text_metafield' of undefined
  </code></pre>
  <p>I created my meta-box with a text field like that :</p>
  <pre><code>import { __ } from '@wordpress/i18n';
  import { useSelect, useDispatch } from '@wordpress/data';
  import { registerPlugin } from '@wordpress/plugins';
  import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
  import { TextControl } from '@wordpress/components';
  
  const TextController = (props) =&gt; {
      const meta = useSelect(
          (select) =&gt;
          select('core/editor').getEditedPostAttribute('meta')['_myprefix_text_metafield']
      );
      const { editPost } = useDispatch('core/editor');
      return (
          &lt;TextControl
          label={__(&quot;Text Meta&quot;, &quot;textdomain&quot;)}
          value={meta}
          onChange={(value) =&gt; editPost({ meta: { _myprefix_text_metafield: value } })}
          /&gt;
      );
  };
  
  const PluginDocumentSettingPanelDemo = () =&gt; (
      &lt;PluginDocumentSettingPanel name=&quot;text-presentation&quot; title=&quot;Texte de présentation&quot; className=&quot;custom-panel custom-panel-presentation&quot; icon=&quot; &quot;&gt;
          &lt;TextController /&gt;
      &lt;/PluginDocumentSettingPanel&gt;
  );
  
  registerPlugin('plugin-document-setting-panel-demo', {
      render: PluginDocumentSettingPanelDemo
  });
  </code></pre>
  <p>And to check if all fields are not empty :</p>
  <pre><code>const locks = [];
  
  function lock( lockIt, handle, message ) {
      if ( lockIt ) {
          if ( ! locks[ handle ] ) {
              locks[ handle ] = true;
              wp.data.dispatch( 'core/editor' ).lockPostSaving( handle );
              wp.data.dispatch( 'core/notices' ).createNotice(
                  'error',
                  message,
                  { id: handle, isDismissible: false }
              );
          }
      } else if ( locks[ handle ] ) {
          locks[ handle ] = false;
          wp.data.dispatch( 'core/editor' ).unlockPostSaving( handle );
          wp.data.dispatch( 'core/notices' ).removeNotice( handle );
      }
  }
  
  wp.data.subscribe( () =&gt; {
      // get presentation
      const textPresentation = wp.data.select( 'core/editor' ).getEditedPostAttribute('meta')['_myprefix_text_metafield'];
  
      // Lock the post if the presentation is empty.
      lock(
          ! textPresentation,
          'presentation-lock',
          'Please add a presentation text',
      );
  
      // get the current title
      const postTitle = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'title' );
  
      // Lock the post if the title is empty.
      lock(
          ! postTitle,
          'title-lock',
          'Please add a title',
      );
  
  
      // get the Featured Image
      const featuredImage = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
  
      // Lock post if there is no Featured Image selected
      lock(
          featuredImage === 0,
          'featured-image-lock',
          'Please add a featured image',
      );
  
  });
  </code></pre>
  <p>When I write this in the console :</p>
  <p><code>wp.data.select( 'core/editor' ).getEditedPostAttribute('meta')['_myprefix_text_metafield'];</code></p>
  <p>The value returned well the value of my text field.</p>