Permalink
Browse files

don't complain about invalid data type unless its provided

  • Loading branch information...
1 parent 6d4b6b4 commit e11f586f06d58cef433d6f8269271a4204a12ade @xdg xdg committed May 11, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Pantry/App/Command/apply.pm
  2. +1 −1 lib/Pantry/App/Command/strip.pm
@@ -59,7 +59,7 @@ sub _apply_obj {
if ( my $method = $setters{$type}{$k} ) {
$self->_set_attributes($obj, $opt, $k, $method);
}
- else {
+ elsif ( $opt->{$k} ) {
$k = ucfirst $k;
warn "$k attributes do not apply to $type objects. Skipping them.\n";
}
@@ -59,7 +59,7 @@ sub _strip_obj {
if ( my $method = $strippers{$type}{$k} ) {
$self->_delete_attributes($obj, $opt, $k, $method);
}
- else {
+ elsif ( $opt->{$k} ) {
$k = ucfirst $k;
warn "$k attributes do not apply to $type objects. Skipping them.\n";
}

0 comments on commit e11f586

Please sign in to comment.