Fixed the wrong endpoint value check when no endpoint is set in config.

When using a default configuration, the default endpoint should be '/app_dev.php', but because of this small bug, the endpoint in overwritten by "undefined" in javascript. Resulting ajax calls going to '/doc/undefined', not working obviously.

Using the typeof fix the problem and makes the right call.