Version 0.22
[gitmo/MooseX-Types.git] / lib / MooseX / Types / Util.pm
index 312df4b..042c362 100644 (file)
@@ -1,4 +1,5 @@
 package MooseX::Types::Util;
+our $VERSION = "0.22";
 
 =head1 NAME
 
@@ -8,6 +9,7 @@ MooseX::Types::Util - Common utility functions for the module
 
 use warnings;
 use strict;
+use Scalar::Util 'blessed';
 
 use base 'Exporter';
 
@@ -88,7 +90,7 @@ sub has_available_type_export {
         or return undef;
 
     return undef
-        unless $sub->isa('MooseX::Types::EXPORTED_TYPE_CONSTRAINT');
+        unless blessed $sub && $sub->isa('MooseX::Types::EXPORTED_TYPE_CONSTRAINT');
 
     return $sub->();
 }