const and basic tracing
[scpubgit/DX.git] / lib / DX / Step / Normal.pm
index 8034c8c..8196461 100644 (file)
@@ -29,7 +29,11 @@ sub but_with_alternative_step {
 
 sub apply_to {
   my ($self, $old_hyp) = @_;
-  return ($self->_apply_to_hyp($old_hyp), $self->alternative_step);
+  trace 'step.apply.old_hyp '.$self => $old_hyp;
+  my $new_hyp = $self->_apply_to_hyp($old_hyp);
+  return (undef, $self->alternative_step) unless $new_hyp;
+  trace 'step.apply.new_hyp '.$self => $new_hyp;
+  return ($new_hyp, $self->alternative_step);
 }
 
 sub _apply_to_hyp {