diff --git a/routers/facebook_api.py b/routers/facebook_api.py index 7a34c484f..ab760b053 100644 --- a/routers/facebook_api.py +++ b/routers/facebook_api.py @@ -141,6 +141,11 @@ def fb_connect_redirect(request: Request): retry_button = ( f'Retry' ) + if not current_run_id or not published_run_id: + return HTMLResponse( + f"

Oh No! Something went wrong here. Please go back to the integration page and try again or contact support.

", + status_code=400, + ) current_run = SavedRun.objects.get(run_id=current_run_id) published_run = PublishedRun.objects.filter( published_run_id=published_run_id