Skip to content

Commit 322de5f

Browse files
committed
Fix crash bug.
1 parent 2f993ee commit 322de5f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

util/data_cache.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,19 @@ def get_all_open_folders(self):
223223
return all_folders
224224

225225
def get_folder_id(self, folder):
226+
result = None
226227
try:
227228
self.lock.acquire(True)
228229
self.db_cur.execute(QUERY_FOLDER, (folder, ))
229-
for (fid, pid) in self.db_cur.fetchall():
230-
return (fid, pid)
230+
result = self.db_cur.fetchall()
231231
finally:
232232
self.lock.release()
233-
return None
233+
234+
if result is None:
235+
return None
236+
for (fid, pid) in result:
237+
return (fid, pid)
238+
234239

235240
def rebuild_module_index(self, filepath):
236241
(folder, filename) = os.path.split(filepath)

0 commit comments

Comments
 (0)