mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
res_geolocation: Ensure required 'location_info' is present.
Fixes #189
(cherry picked from commit e120694711
)
This commit is contained in:
committed by
Asterisk Development Team
parent
dd76dfdd57
commit
db8601dd77
@@ -168,6 +168,12 @@ static int geoloc_location_apply_handler(const struct ast_sorcery *sorcery, void
|
|||||||
enum ast_geoloc_validate_result result;
|
enum ast_geoloc_validate_result result;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
if (!location->location_info) {
|
||||||
|
ast_log(LOG_ERROR, "Location '%s' is missing required element 'location_info'",
|
||||||
|
location_id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
result = validate_location_info(location_id, location->format, location->location_info);
|
result = validate_location_info(location_id, location->format, location->location_info);
|
||||||
if (result != AST_GEOLOC_VALIDATE_SUCCESS) {
|
if (result != AST_GEOLOC_VALIDATE_SUCCESS) {
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user