Add error checking on "profile" for SQLA::Tree
[dbsrgits/SQL-Abstract.git] / lib / SQL / Abstract / Tree.pm
index 5bfcc67..f6076ba 100644 (file)
@@ -284,6 +284,9 @@ sub new {
    my $args  = shift || {};
 
    my $profile = delete $args->{profile} || 'none';
+
+   die "No such profile '$profile'!" unless exists $profiles{$profile};
+
    my $data = $merger->merge( $profiles{$profile}, $args );
 
    bless $data, $class