Skip to content

Commit

Permalink
Check invalid timestamp value
Browse files Browse the repository at this point in the history
Related to commit 9046bb5
  • Loading branch information
ueno committed Sep 16, 2014
1 parent 6e68d13 commit 88b8f76
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/gpgme/sub_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ class SubKey
include KeyCommon

def timestamp
Time.at(@timestamp)
case @timestamp
when -1, 0
# FIXME: add a special value for invalid timestamp, or throw an error
return nil
else
return Time.at(@timestamp)
end
end

def expires?
Expand Down

0 comments on commit 88b8f76

Please sign in to comment.