aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2014-10-26 02:38:36 +0200
committerSebastian Pipping <sebastian@pipping.org>2014-10-26 02:41:44 +0200
commitf504f41fdb7159dee07ce2e67c67f7f8522a1f84 (patch)
tree828fc611799ee9c9cf582915fa8bf61197357568
parentRelease 0.7.6.3 (diff)
downloadelogv-f504f41fdb7159dee07ce2e67c67f7f8522a1f84.tar.gz
elogv-f504f41fdb7159dee07ce2e67c67f7f8522a1f84.tar.bz2
elogv-f504f41fdb7159dee07ce2e67c67f7f8522a1f84.zip
Fix crash when log files with bad names are found, only
-rw-r--r--ChangeLog3
-rwxr-xr-xelogv6
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8376196..77063cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
# ChangeLog for elogv
+0.7.6.4
+ * Fix crash when log files with bad names are found, only
+
0.7.6.3
* Prevent crash with LC_TIME=ja_JP.UTF-8 (Gentoo bug #464962)
diff --git a/elogv b/elogv
index c5a4b33..1eb04c4 100755
--- a/elogv
+++ b/elogv
@@ -361,9 +361,6 @@ class ElogViewer:
except OSError:
raise CannotOpenElogdir()
- if not file_list:
- raise NoLogFiles()
-
# self.packages contains all info extracted from each file, this is the
# structure:
# [ ("filename", "category", "package name", date:datetime_obj, class:int), ... ]
@@ -395,6 +392,9 @@ class ElogViewer:
date = datetime(int(date_str[:4]),int(date_str[4:6]),int(date_str[6:]))
self.packages.append( (filepath, cat, pn, date, self.get_class(filepath)) )
+ if not self.packages:
+ raise NoLogFiles()
+
# Maybe that after removing files self.usel points to a wrong index,
# so this will prevent a crash
if self.usel >= len(self.packages):