diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-11-17 22:25:48 +0100 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-11-17 22:26:22 +0100 |
commit | 51f48392abb225eaed58a6368382cdc28a961d3b (patch) | |
tree | 30219556ffba31ce9eda02be29d8f2f2f27576a0 | |
parent | d412abd10886c76968278d655ac3a0c01fef0329 (diff) | |
download | gitlab-ce-51f48392abb225eaed58a6368382cdc28a961d3b.tar.gz |
Fix type error if there is a different location hash
-rw-r--r-- | app/assets/javascripts/tree.js.coffee | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/tree.js.coffee b/app/assets/javascripts/tree.js.coffee index 8ef41e16853..3f8ed6c2552 100644 --- a/app/assets/javascripts/tree.js.coffee +++ b/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() |