Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Fix #18 - Prevent crash when no git log is found
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-code committed Apr 10, 2015
1 parent ebc9b8b commit 9d07790
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/LogReader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,12 @@ end
-- @param logpath
--
function LogReader.init(logpath, delay, playmode, autoplay)
if not isLogFile(logpath) then
return {};
if isLogFile(logpath) then
log = splitCommits(readLogFile(logpath));
else
log = {};
end

local logFile = readLogFile(logpath);
log = splitCommits(logFile);

-- Set default values.
index = 0;
if playmode == 'default' then
Expand Down

0 comments on commit 9d07790

Please sign in to comment.