"Call to a member function label() on null", while it's defined
You have to check if you are in a node hook: 

if ($hook != 'node') {
  return;
}


In other hooks you don't have a node object and the function label() is called on null.

Though you might want to check the machine name of the node type, because the display name can change when you have multiple languages:

$node-&gt;getType()