Revision history for Catalyst-Plugin-Authentication-Store-DBIx-Class
+ * Return undef if there isn't a user. This will cause an exception
+ but a more helpful exception (probably from DBIC) than the inability
+ to call a method in this code.
+
0.1504 2012-10-05
* Make use_userdata_from_session use inflate_result since this is
already-stored data, not a "new" object being created
my $self = shift;
return $self->SUPER::can(@_) || do {
my ($method) = @_;
- if (my $code = $self->_user->can($method)) {
+ if (not $self->_user) {
+ undef;
+ } elsif (my $code = $self->_user->can($method)) {
sub { shift->_user->$code(@_) }
} elsif (my $accessor =
try { $self->_user->result_source->column_info($method)->{accessor} }) {