aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toplevel/vernacentries.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml
index ebe1e4fbed..d4cacf68b7 100644
--- a/toplevel/vernacentries.ml
+++ b/toplevel/vernacentries.ml
@@ -1496,7 +1496,10 @@ let vernac_undoto n =
let vernac_focus gln =
let p = Proof_global.give_me_the_proof () in
let n = match gln with None -> 1 | Some n -> n in
- Proof.focus focus_command_cond () n p; print_subgoals ()
+ if n = 0 then
+ Errors.error "Invalid goal number: 0. Goal numbering starts with 1."
+ else
+ Proof.focus focus_command_cond () n p; print_subgoals ()
(* Unfocuses one step in the focus stack. *)
let vernac_unfocus () =