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);
|
writeRecord(rec);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
_currentOut.flush();
|
if (_currentOut != null)
|
||||||
|
_currentOut.flush();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
if (++_diskFullMessageCount < MAX_DISKFULL_MESSAGES)
|
if (++_diskFullMessageCount < MAX_DISKFULL_MESSAGES)
|
||||||
System.err.println("Error writing the router log - disk full? " + ioe);
|
System.err.println("Error writing the router log - disk full? " + ioe);
|
||||||
@@ -180,7 +181,8 @@ class LogWriter implements Runnable {
|
|||||||
try {
|
try {
|
||||||
_currentOut = new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(f), "UTF-8"));
|
_currentOut = new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(f), "UTF-8"));
|
||||||
} catch (IOException ioe) {
|
} 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