Avoid FileWriter scheduled task NPE (#205)
[Bug] fileOutputStream in FileWriter has been flushed and cleared when switching to a new file, which causes NPE. Fix https://github.com/apache/skywalking/issues/9201
This commit is contained in:
parent
372d754030
commit
c8840b010c
|
|
@ -23,6 +23,7 @@ Release Notes.
|
|||
* Fix argument type name of Array in postgresql-8.x-plugin from java.lang.String[] to [Ljava.lang.String;
|
||||
* Add type name checking in ArgumentTypeNameMatch and ReturnTypeNameMatch
|
||||
* Highlight ArgumentTypeNameMatch and ReturnTypeNameMatch type naming rule in docs/en/setup/service-agent/java-agent/Java-Plugin-Development-Guide.md
|
||||
* Fix FileWriter scheduled task NPE
|
||||
|
||||
#### Documentation
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,9 @@ public class FileWriter implements IWriter {
|
|||
writeToFile(log + Constants.LINE_SEPARATOR);
|
||||
}
|
||||
try {
|
||||
fileOutputStream.flush();
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.flush();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue