diff --git a/lib/Zarn/Engine/Source_to_Sink.pm b/lib/Zarn/Engine/Source_to_Sink.pm index c4d07c9..dc9c714 100644 --- a/lib/Zarn/Engine/Source_to_Sink.pm +++ b/lib/Zarn/Engine/Source_to_Sink.pm @@ -20,7 +20,7 @@ package Zarn::Engine::Source_to_Sink { ); if ($ast && $rules) { - foreach my $token (@{$ast -> find('PPI::Token')}) { + foreach my $token (@{$ast -> find('PPI::Token') || []}) { foreach my $rule (@{$rules}) { my @sample = $rule -> {sample} -> @*; my $category = $rule -> {category}; @@ -63,4 +63,4 @@ package Zarn::Engine::Source_to_Sink { } } -1; \ No newline at end of file +1;