Skip to content

Commit

Permalink
Handle module->version being undef
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Sep 15, 2014
1 parent c2b0b81 commit 2cf4249
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Release history for App-cpanoutdated-fresh

{{$NEXT}}
[Bugfix]
- Handle module->version being undef

0.001003 2014-09-15T02:48:14Z
[Bugfix]
Expand Down
8 changes: 5 additions & 3 deletions lib/App/cpanoutdated/fresh.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,19 @@ sub _check_fresh {
my $mm = Module::Metadata->new_from_file($file);
return if not $mm;

my $mm_version = $mm->version;

my $v = version->parse( $module->{version} );

if ( $mm->version >= $v ) {
if ( $mm_version >= $v ) {
return;
}

return {
name => $module->{name},
cpan => $v->stringify,
cpan => ( $v ? $v->stringify : q[0] ),
release => $data_hash->{release},
installed => $mm->version->stringify,
installed => ( $mm_version ? $mm_version->stringify : q[0] ),
meta => $data_hash,
};

Expand Down

0 comments on commit 2cf4249

Please sign in to comment.