ARI: Fixed crash that occurred when updating a bridge when the optional query paramet...
[asterisk/asterisk.git] / res / ari / resource_bridges.c
index 45fa09d..2dfb1cf 100644 (file)
@@ -949,16 +949,18 @@ void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers,
 
        if (bridge) {
                /* update */
-               if (strcmp(args->name, bridge->name)) {
-                       ast_ari_response_error(
-                               response, 500, "Internal Error",
-                               "Changing bridge name is not implemented");
-                       return;
+               if (!ast_strlen_zero(args->name)) {
+                       if (!strcmp(args->name, bridge->name)) {
+                               ast_ari_response_error(
+                                       response, 500, "Internal Error",
+                                       "Changing bridge name is not implemented");
+                               return;
+                       }
                }
                if (!ast_strlen_zero(args->type)) {
                        ast_ari_response_error(
                                response, 500, "Internal Error",
-                               "Changing bridge type is not implemented");
+                               "Supplying a bridge type when updating a bridge is not allowed.");
                        return;
                }
                ast_ari_response_ok(response,