Robert, quick issue when running qunit tests unrelated to this plugin. It makes the tests fail.
I think writing custom_fields?.location_enabled should be enough.
custom_fields?.location_enabled