projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6951e5c
)
fix errors in DXUser deserialising Users
author
Dirk Koopman
<djk@tobit.co.uk>
Fri, 9 Mar 2012 22:37:50 +0000
(22:37 +0000)
committer
Dirk Koopman
<djk@tobit.co.uk>
Fri, 9 Mar 2012 22:37:50 +0000
(22:37 +0000)
perl/DXUser.pm
patch
|
blob
|
history
diff --git
a/perl/DXUser.pm
b/perl/DXUser.pm
index 84b6df3dd721ee99704c0a8867ece5c09dd8235a..d7a433261acef9a182b4556a5018ded24dc34c39 100644
(file)
--- a/
perl/DXUser.pm
+++ b/
perl/DXUser.pm
@@
-368,30
+368,37
@@
sub get
# is it in the LRU cache?
my $ref = $lru->get($call);
# is it in the LRU cache?
my $ref = $lru->get($call);
- return $ref if $ref &&
ref $ref eq 'DXUser'
;
+ return $ref if $ref &&
UNIVERSAL::isa($ref, 'DXUser')
;
# search for it
if ($v4) {
if ($data = _select($call)) {
$ref = bless decode_json($data), 'DXUser';
# search for it
if ($v4) {
if ($data = _select($call)) {
$ref = bless decode_json($data), 'DXUser';
+ unless ($ref) {
+ dbg("DXUser::get: no reference returned from decode of $call $!");
+ return undef;
+ }
}
} else {
unless ($dbm->get($call, $data)) {
$ref = decode($data);
}
} else {
unless ($dbm->get($call, $data)) {
$ref = decode($data);
+ unless ($ref) {
+ dbg("DXUser::get: no reference returned from decode of $call $!");
+ return undef;
+ }
}
}
if ($ref) {
}
}
if ($ref) {
- if (UNIVERSAL::isa($ref, 'DXUser')) {
+ if (
!
UNIVERSAL::isa($ref, 'DXUser')) {
dbg("DXUser::get: got strange answer from decode of $call". ref $ref. " ignoring");
return undef;
}
dbg("DXUser::get: got strange answer from decode of $call". ref $ref. " ignoring");
return undef;
}
+
# we have a reference and it *is* a DXUser
# we have a reference and it *is* a DXUser
- } else {
- dbg("DXUser::get: no reference returned from decode of $call $!");
- return undef;
+ $lru->put($call, $ref);
+ return $ref;
}
}
- $lru->put($call, $ref);
return undef;
}
return undef;
}