Skip to content

Commit

Permalink
better check for duration
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgamr committed Jul 5, 2015
1 parent a999972 commit abb4af9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/jsx/trackList.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ window.TrackItem = React.createClass({
this.props.onStarTrack(this.props.track);
},
seconds2time: function (value) {
if (!value) return 'N/A';
if (!value || value < 0) return 'N/A';
var hours = Math.floor(value / 3600),
mins = '0' + Math.floor((value % 3600) / 60),
secs = '0' + Math.floor((value % 60));
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/trackList.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ window.TrackItem = React.createClass({displayName: "TrackItem",
this.props.onStarTrack(this.props.track);
},
seconds2time: function (value) {
if (!value) return 'N/A';
if (!value || value < 0) return 'N/A';
var hours = Math.floor(value / 3600),
mins = '0' + Math.floor((value % 3600) / 60),
secs = '0' + Math.floor((value % 60));
Expand Down

0 comments on commit abb4af9

Please sign in to comment.