Skip creating package if no name (must have been an error in the source file
Ken Youens-Clark [Thu, 4 Dec 2003 18:48:33 +0000 (18:48 +0000)]
not caught by "validate").

lib/SQL/Translator/Producer/ClassDBI.pm

index 726eb81..ec72fce 100755 (executable)
@@ -1,7 +1,7 @@
 package SQL::Translator::Producer::ClassDBI;
 
 # -------------------------------------------------------------------
-# $Id: ClassDBI.pm,v 1.38 2003-10-15 19:56:13 allenday Exp $
+# $Id: ClassDBI.pm,v 1.39 2003-12-04 18:48:33 kycl4rk Exp $
 # -------------------------------------------------------------------
 # Copyright (C) 2003 Allen Day <allenday@ucla.edu>,
 #                    Ying Zhang <zyolive@yahoo.com>
@@ -23,7 +23,7 @@ package SQL::Translator::Producer::ClassDBI;
 
 use strict;
 use vars qw[ $VERSION $DEBUG ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.38 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.39 $ =~ /(\d+)\.(\d+)/;
 $DEBUG = 1 unless defined $DEBUG;
 
 use SQL::Translator::Schema::Constants;
@@ -315,7 +315,8 @@ sub produce {
         sort { $packages{ $a }{'order'} <=> $packages{ $b }{'order'} }
         keys %packages
     ) {
-        my $pkg = $packages{$pkg_name};
+        my $pkg = $packages{$pkg_name} or next;
+        next unless $pkg->{'pkg_name'};
 
         $create .= join ( "\n",
             $sep,