title: Vue Error in v-on handler: "TypeError: Cannot read properties of null"
body: <p>I have a method to toggle a value of the user's profile. The method triggers whenever the form is changed (whenever the checkbox is clicked).</p>
  <p>The form looks like this:</p>
  <pre><code>&lt;form v-if=&quot;!this.StateUser.message.isPrivate&quot; @change=&quot;privateTrue(this.StateUser.message._id)&quot;&gt;
          &lt;input type=&quot;checkbox&quot;/&gt;
  &lt;/form&gt;
  </code></pre>
  <p>And my method looks like this:</p>
  <pre><code>privateTrue (id) {
        axios.patch('/user/private-true/' + id)
          .then(res =&gt; {
            console.log(res)
          })
      },
  </code></pre>
  <p>The error it returns is
  <strong>Error in v-on handler: &quot;TypeError: Cannot read properties of null (reading 'StateUser')&quot;</strong></p>
  <p>StateUser is a getter from Vuex, and it seems like it can not read that value. Is this a problem with Vuex, or the v-on method not accepting vuex values? The issue is the same if I replace with the $store variable.</p>
  <p>Any idea what is causing this?</p>