Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Only delete subscription if it exists

Uku Taht9f7b5b9533f5
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.ex
index eee622f5aa..c1053be46c 100644
--- a/lib/plausible_web/controllers/auth_controller.ex
+++ b/lib/plausible_web/controllers/auth_controller.ex
@@ -183,7 +183,7 @@ defmodule PlausibleWeb.AuthController do
Repo.delete!(site)
end
- Repo.delete!(user.subscription)
+ if user.subscription, do: Repo.delete!(user.subscription)
Repo.delete!(user)
logout(conn, params)