Merge pull request #257 from dpavlin/master

fix crash on documents without TOC
This commit is contained in:
Dobrica Pavlinušić
2012-09-09 04:21:06 -07:00

View File

@@ -1738,9 +1738,11 @@ function UniReader:showToc()
prev = k
prev_depth = self.toc[prev].depth
end -- for k,v in ipairs(self.toc)
self.toc_curidx_to_x = self.toc_children[0]
for i=1,#self.toc_children[0] do
table.insert(self.toc_cview, self.toc_xview[self.toc_children[0][i]])
if ( self.toc_children[0] ) then
self.toc_curidx_to_x = self.toc_children[0]
for i=1,#self.toc_children[0] do
table.insert(self.toc_cview, self.toc_xview[self.toc_children[0][i]])
end
end
end