From 2554a45a151922036622cb04689a0883bb36c4dc Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 28 Oct 2010 16:54:07 -0700 Subject: [PATCH] Throw an exception if you don't get a session argument in classic WebGUI instanciator syntax. --- lib/WebGUI/Shop/Credit.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WebGUI/Shop/Credit.pm b/lib/WebGUI/Shop/Credit.pm index 80d26e944..554baca41 100644 --- a/lib/WebGUI/Shop/Credit.pm +++ b/lib/WebGUI/Shop/Credit.pm @@ -45,7 +45,7 @@ around BUILDARGS => sub { my $userId = $_[1] ? $_[1] : $protoSession->user->userId; return $className->$orig(session => $protoSession, userId => $userId, ); } - return $className->$orig(@_); + WebGUI::Error::InvalidParam->throw(error => "Need a session."); };