fix DXUser UNIVERSAL::isa typo
[spider.git] / perl / DXUser.pm
index 94fa3d1a9ff1549fe2659b69444fef2915c565a9..25672f969d7f8502160b1c941f9490c3f0eb4cf5 100644 (file)
@@ -249,12 +249,13 @@ sub get
        unless ($dbm->get($call, $data)) {
                $ref = decode($data);
                if ($ref) {
-                       if (ref $ref ne 'DXUser') {
-                               dbg("DXUser::get: got strange answer from decode ". ref $ref. " ignoring");
+                       if (!UNIVERSAL::isa($ref, 'DXUser')) {
+                               dbg("DXUser::get: got strange answer from decode of $call". ref $ref. " ignoring");
                                return undef;
                        }
+                       # we have a reference and it *is* a DXUser
                } else {
-                       dbg("DXUser::get: no reference returned from decode $!");
+                       dbg("DXUser::get: no reference returned from decode of $call $!");
                        return undef;
                }
                $lru->put($call, $ref);
@@ -278,9 +279,9 @@ sub get_current
        my $dxchan = DXChannel::get($call);
        if ($dxchan) {
                my $ref = $dxchan->user;
-               return $ref if ref $ref eq 'DXUser';
+               return $ref if $ref && UNIVERSAL::isa($ref, 'DXUser');
 
-               dbg("DXUser::get_current: got invalid user ref from dxchan $dxchan->{call} ". ref $ref. " ignoring");
+               dbg("DXUser::get_current: got invalid user ref for $call from dxchan $dxchan->{call} ". ref $ref. " ignoring");
        }
        return get($call);
 }