fix exception for empty content in TikzManager
This commit is contained in:
@@ -22,8 +22,8 @@ module.exports = TikzManager =
|
|||||||
|
|
||||||
_includesTikz: (resource) ->
|
_includesTikz: (resource) ->
|
||||||
# check if we are using tikz externalize
|
# check if we are using tikz externalize
|
||||||
content = resource.content.slice(0,65536)
|
content = resource.content?.slice(0,65536)
|
||||||
if content.indexOf("\\tikzexternalize") >= 0
|
if content?.indexOf("\\tikzexternalize") >= 0
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -30,6 +30,12 @@ describe 'TikzManager', ->
|
|||||||
{ path: 'output.tex' }
|
{ path: 'output.tex' }
|
||||||
]).should.equal false
|
]).should.equal false
|
||||||
|
|
||||||
|
it "should return false if the file has no content", ->
|
||||||
|
@TikzManager.needsOutputFile("main.tex", [
|
||||||
|
{ path: 'foo.tex' },
|
||||||
|
{ path: 'main.tex' }
|
||||||
|
]).should.equal false
|
||||||
|
|
||||||
describe "injectOutputFile", ->
|
describe "injectOutputFile", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@rootDir = "/mock"
|
@rootDir = "/mock"
|
||||||
|
|||||||
Reference in New Issue
Block a user