mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
Tailer当文件内容为空时,会报异常,添加防止空指针
This commit is contained in:
parent
d3f7fdcdd5
commit
43c0cf0a0b
@ -153,7 +153,7 @@ public class Tailer implements Serializable {
|
||||
Stack<String> stack = new Stack<>();
|
||||
|
||||
long start = this.randomAccessFile.getFilePointer();
|
||||
long nextEnd = len - 1;
|
||||
long nextEnd = (len - 1) < 0 ? 0 : len - 1;
|
||||
this.randomAccessFile.seek(nextEnd);
|
||||
int c;
|
||||
int currentLine = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user