Wauplin HF staff commited on
Commit
8e54bfd
1 Parent(s): b23c183
Files changed (1) hide show
  1. open_pr.py +2 -0
open_pr.py CHANGED
@@ -51,6 +51,8 @@ def open_pr(space_id_or_url: str, oauth_token: gr.OAuthToken | None) -> str:
51
 
52
  api = HfApi(token=token)
53
 
 
 
54
  space_id = (
55
  RepoUrl(space_id_or_url).repo_id if "https://huggingface.co/spaces/" in space_id_or_url else space_id_or_url
56
  )
 
51
 
52
  api = HfApi(token=token)
53
 
54
+ if not space_id:
55
+ raise gr.Error("You must input a Space ID or URL.")
56
  space_id = (
57
  RepoUrl(space_id_or_url).repo_id if "https://huggingface.co/spaces/" in space_id_or_url else space_id_or_url
58
  )