only test type if we have an object
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Mar 2008 17:27:41 +0000 (17:27 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Mar 2008 17:27:41 +0000 (17:27 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8972 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm

index f21f8dd..883d9fd 100644 (file)
@@ -62,7 +62,7 @@ sub CRUD_action_object_permcheck {
     my $e = new_editor(authtoken => $auth, xact => 1);
     return $e->event unless $e->checkauth;
 
-    unless ($obj->json_hint eq $self->{class_hint}) {
+    if (ref($obj) && $obj->json_hint ne $self->{class_hint}) {
         throw OpenSRF::DomainObject::oilsException->new(
             statusCode => 500,
             status => "Class missmatch: $self->{class_hint} method called with " . $obj->json_hint,