Skip to content

Commit f47b141

Browse files
author
Jon Ludlam
committed
Merge pull request #1012 from siddharthv/CA-97297
CA-97297: ErrorMsg - Cannot remove parameters from read-only map
2 parents 6a8ebd7 + 6f1709b commit f47b141

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ocaml/xapi/cli_operations.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ let make_param_funs getall getallrecs getbyuuid record class_name def_filters de
704704
match field_lookup record param_name with
705705
| { get_set = Some g; remove_from_set = Some f } -> if List.mem param_key (g ()) then f param_key else failwith "Key is not in the set"
706706
| { get_map = Some g; remove_from_map = Some f } -> if List.mem_assoc param_key (g ()) then f param_key else failwith "Key is not in map"
707+
| { get_set = Some _; remove_from_set = None }
708+
| { get_map = Some _; remove_from_map = None } -> failwith "Cannot remove parameters from read-only map"
707709
| _ -> failwith "Can only remove from parameters of type Set or Map"
708710
in
709711

0 commit comments

Comments
 (0)