Whitelist null_pointer error so that custom entities with spaces in the ...

...name that don't exist are considered non existent, and not something else bad happening. Also, URI encode the entity name.