Skip to content

Commit

Permalink
www: Don't fail fetching text from generated files
Browse files Browse the repository at this point in the history
Do not raise an exception if a query happened to hit a
generated and deleted file which couldn't make it to
the FTS table. Whether those files have a presence in
the DB or not is still debatable.
  • Loading branch information
Carlos Garnacho committed Apr 4, 2012
1 parent 61c03e5 commit 5325f1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions www/search.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def like_escape(val):

def GetLine(rowid, line, col):
row = conn.execute('SELECT fts.content, (SELECT path FROM files where files.ID = fts.rowid) FROM fts where fts.rowid = ?', (rowid,)).fetchone()

if row is None:
return ''

text = row[0]
fname = row[1]
text_start = 0
Expand Down

0 comments on commit 5325f1b

Please sign in to comment.