forked from I2P_Developers/i2p.i2p
* LogWriter: Prevent NPE after permissions fail
This commit is contained in:
@ -77,7 +77,8 @@ class LogWriter implements Runnable {
|
||||
writeRecord(rec);
|
||||
}
|
||||
try {
|
||||
_currentOut.flush();
|
||||
if (_currentOut != null)
|
||||
_currentOut.flush();
|
||||
} catch (IOException ioe) {
|
||||
if (++_diskFullMessageCount < MAX_DISKFULL_MESSAGES)
|
||||
System.err.println("Error writing the router log - disk full? " + ioe);
|
||||
@ -180,7 +181,8 @@ class LogWriter implements Runnable {
|
||||
try {
|
||||
_currentOut = new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(f), "UTF-8"));
|
||||
} catch (IOException ioe) {
|
||||
System.err.println("Error rotating into [" + f.getAbsolutePath() + "]" + ioe);
|
||||
if (++_diskFullMessageCount < MAX_DISKFULL_MESSAGES)
|
||||
System.err.println("Error creating log file [" + f.getAbsolutePath() + "]" + ioe);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user