I have created a content entity type. When I save form, I got id in routing url, like:
But if I directly access some non-existing id like
entityform/999, page dies.
In watchdog, it is showing error,
Error: Call to a member function get() on null in Drupal...
I can not call function get() on the fields of entity, if entity doesn't exists.
$content_type = $entity->get('ctype')->value;
How to apply this check, whether entity actually created or not?