From: Ken Youens-Clark Date: Thu, 4 Dec 2003 18:48:33 +0000 (+0000) Subject: Skip creating package if no name (must have been an error in the source file X-Git-Tag: v0.06~253 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b183a0277dc303b883ee8c4a7d7f58bcb73ad10;p=dbsrgits%2FSQL-Translator.git Skip creating package if no name (must have been an error in the source file not caught by "validate"). --- diff --git a/lib/SQL/Translator/Producer/ClassDBI.pm b/lib/SQL/Translator/Producer/ClassDBI.pm index 726eb81..ec72fce 100755 --- a/lib/SQL/Translator/Producer/ClassDBI.pm +++ b/lib/SQL/Translator/Producer/ClassDBI.pm @@ -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 , # Ying Zhang @@ -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,