[Bps-public-commit] r9609 - in Net-Server-IMAP: lib/Net/Server/IMAP

alexmv at bestpractical.com alexmv at bestpractical.com
Tue Nov 6 16:21:57 EST 2007


Author: alexmv
Date: Tue Nov  6 16:21:54 2007
New Revision: 9609

Modified:
   Net-Server-IMAP/   (props changed)
   Net-Server-IMAP/lib/Net/Server/IMAP/Mailbox.pm

Log:
 r24494 at zoq-fot-pik:  chmrr | 2007-11-06 16:21:27 -0500
  * Mailbox creation can fail if the name already exists


Modified: Net-Server-IMAP/lib/Net/Server/IMAP/Mailbox.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP/Mailbox.pm	(original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP/Mailbox.pm	Tue Nov  6 16:21:54 2007
@@ -13,6 +13,7 @@
 sub new {
     my $class = shift;
     my $self  = $class->SUPER::new(@_);
+    return if $self->parent and grep {$self->full_path eq $_->full_path} @{$self->parent->children};
     $self->init;
     $self->load_data;
     return $self;
@@ -107,6 +108,7 @@
     my $self = shift;
     my $node = ( ref $self )
         ->new( { @_, parent => $self } );
+    return unless $node;
     push @{ $self->children }, $node;
     return $node;
 }



More information about the Bps-public-commit mailing list