this test should be for definedness
[gitmo/Moose.git] / lib / Moose / Error / Default.pm
index 2588083..a5c44de 100644 (file)
@@ -17,7 +17,7 @@ Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
 
 sub new {
     my ( $self, @args ) = @_;
-    if(exists $ENV{MOOSE_ERROR_STYLE} && $ENV{MOOSE_ERROR_STYLE} eq 'croak') {
+    if (defined $ENV{MOOSE_ERROR_STYLE} && $ENV{MOOSE_ERROR_STYLE} eq 'croak') {
         $self->create_error_croak( @args );
     }
     else {