DDG.require('maps',function(){
    ddg_spice_maps_maps = function(response) {
        
        if (!response) { return Spice.failed('maps'); }

        // OSM sends back a bunch of places, just want the first one for now
        response = response.features[0]; 

        response.address=response.place_name;
                                
        if (response.relevance < 0.9) { 
            return Spice.failed('maps'); 
        } 

        Spice.add({
            data: response,
            id: "maps",
            name: "maps",
            model: "Place"
        });

    };
});

DDG.require('maps',function(){
    ddg_spice_maps_maps = function(response) {
        
        if (!response || !response.features || !response.features.length) { return Spice.failed('maps'); }

        // Mapbox sends back a bunch of places, just want the first one for now
        response = response.features[0]; 
                                
        if (response.relevance < 0.9) { 
            return Spice.failed('maps'); 
        } 

        Spice.add({
            data: response,
            id: "maps",
            name: "maps",
            model: "Place"
        });

    };
});

Add guards for null values. Move address formatting to internal pr
Add guards for null values. Move address formatting to internal pr
