Created
December 2, 2010 18:57
-
-
Save berekuk/725851 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Perl/PrereqScanner.pm b/lib/Perl/PrereqScanner.pm | |
index 1c1a81e..55e2570 100644 | |
--- a/lib/Perl/PrereqScanner.pm | |
+++ b/lib/Perl/PrereqScanner.pm | |
@@ -60,6 +60,7 @@ Version::Requirements object describing the modules it requires. | |
sub scan_string { | |
my ($self, $str) = @_; | |
my $ppi = PPI::Document->new( \$str ); | |
+ return Version::Requirements->new unless defined $ppi; | |
return $self->scan_ppi_document( $ppi ); | |
} | |
@@ -76,6 +77,7 @@ Version::Requirements object describing the modules it requires. | |
sub scan_file { | |
my ($self, $path) = @_; | |
my $ppi = PPI::Document->new( $path ); | |
+ return Version::Requirements->new unless defined $ppi; | |
return $self->scan_ppi_document( $ppi ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment