mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-23 06:07:56 +00:00
fix exception for empty content in TikzManager
This commit is contained in:
parent
4a4f3bb24c
commit
fd5b557dde
2 changed files with 8 additions and 2 deletions
|
@ -22,8 +22,8 @@ module.exports = TikzManager =
|
|||
|
||||
_includesTikz: (resource) ->
|
||||
# check if we are using tikz externalize
|
||||
content = resource.content.slice(0,65536)
|
||||
if content.indexOf("\\tikzexternalize") >= 0
|
||||
content = resource.content?.slice(0,65536)
|
||||
if content?.indexOf("\\tikzexternalize") >= 0
|
||||
return true
|
||||
else
|
||||
return false
|
||||
|
|
|
@ -30,6 +30,12 @@ describe 'TikzManager', ->
|
|||
{ path: 'output.tex' }
|
||||
]).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", ->
|
||||
beforeEach ->
|
||||
@rootDir = "/mock"
|
||||
|
|
Loading…
Add table
Reference in a new issue