fix a crash when lastline.length = 0
Merge pull request #4 from dropperY/feature-custom-truncation

 fix a crash when the length or location of lastLine is 0