Programming Phoenix LiveView B10.0: Demographic display logic explanation does not match code (page 221)

The second paragraph on page 221 describes the demographic display logic:

… If no demographic exists, and the socket assigns key of :demographic points to nil, the template renders the demographic form. Otherwise, we render the demographic show component and call on the RatingLive.Index.products/1 function component to add the product ratings to our view.

The logic in survey_live.html.heex is reversed. The code tests for the existence of @demographic rather than it’s non-existence:

<%= if @demographic do %>
  <DemographicLive.Show.details demographic={@demographic} />
  <hr />
  <br/>
  <RatingLive.Index.product_list products={@products}
  current_user={@current_user} />
<% else %>
  <!-- ... -->
<% end %>

Also, the first sentence shown above contains the phrase “points to nil.” Earlier, on page 197, the book used the phrase “set to nil”:

So, the :demographic key in socket assigns could be set to a demographic struct, or it could be set to nil.

Could the description be reordered to match the code? Perhaps:

… If a demographic exists, the :demographic key in socket assigns will be set to a demographic struct; the template renders the demographic show component and calls the RatingLive.Index.products/1 function component to add the product ratings to our view. Otherwise, the :demographic key in socket assigns will be set to nil; the template renders the demographic form.