Improve check for local URLs in paper.resolvePath()

This commit is contained in:
Jürg Lehni 2016-04-04 23:30:53 -07:00
parent 7cf844886f
commit ae9ff56260

View file

@ -294,7 +294,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
resolvePath: function(url) {
// On Node.js, resolve relative URLs to local files:
return this.agent.node && !/^(?:[a-z]+:)?\/\//i.test(url)
return url && this.agent.node && !/^[a-z]+:/i.test(url)
? 'file://' + require('path').resolve(url) : url;
},