Skip to content

Commit

Permalink
Fix crash against URL without anything after the domain eg http://bin…
Browse files Browse the repository at this point in the history
  • Loading branch information
danmoseley committed Aug 4, 2015
1 parent 688279e commit ceb9025
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swi.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def scriptParsed(self, data, notification):
url = data['url']
if url != '':
url_parts = url.split("/")
url_parts = list(filter(None, url_parts)) # remove empty entries so we have eg ['http:', 'foo.com', 'bar', 'baz.biz']
scriptId = str(data['scriptId'])
file_name = ''
script = get_script(data['url'])
Expand All @@ -289,7 +290,7 @@ def scriptParsed(self, data, notification):
# Create a file mapping to look for mapped source code
projectsystem.DocumentMapping.MappingsManager.create_mapping(file_name)
else:
del url_parts[0:3]
del url_parts[0:2] # remove protocol and domain
while len(url_parts) > 0:
for folder in self.project_folders:
if sublime.platform() == "windows":
Expand Down

0 comments on commit ceb9025

Please sign in to comment.