Skip to content

Commit

Permalink
Fix undefined behavior with substring with empty location.search
Browse files Browse the repository at this point in the history
  • Loading branch information
v6ak committed Sep 22, 2023
1 parent 27458c4 commit cc6d9c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/main/scala/com/v6ak/zbdb/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object App {
dom.console.log("startTime", startTime.toString)
dom.console.log("endTime", endTime.toString)
dom.console.log("fileName", fileName)
val params = dom.window.location.search.substring(1).split("&").map{paramString =>
val params = dom.window.location.search.drop(1).split("&").map{paramString =>
paramString.split("=", 2) match {
case Array(name, value) => (name, value)
case Array(name) => (name, "")
Expand Down

0 comments on commit cc6d9c4

Please sign in to comment.