Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix type error if there is a different location hash

  • Loading branch information...
commit 51f48392abb225eaed58a6368382cdc28a961d3b 1 parent d412abd
@riyad riyad authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/assets/javascripts/tree.js.coffee
View
8 app/assets/javascripts/tree.js.coffee
@@ -40,12 +40,12 @@ $ ->
# "#L12" and "#L34-56" supported
highlightBlobLines = ->
if window.location.hash isnt ""
- matches = window.location.hash.match /\#L(\d+)(\-(\d+))?/
- first_line = parseInt matches[1]
- last_line = parseInt matches[3]
+ matches = window.location.hash.match(/\#L(\d+)(\-(\d+))?/)
+ first_line = parseInt(matches?[1])
+ last_line = parseInt(matches?[3])
unless isNaN first_line
- last_line = first_line if isNaN last_line
+ last_line = first_line if isNaN(last_line)
$("#tree-content-holder .highlight .line").removeClass("hll")
$("#LC#{line}").addClass("hll") for line in [first_line..last_line]
$("#L#{first_line}").ScrollTo()
Please sign in to comment.
Something went wrong with that request. Please try again.