Don't crash if unexpected comment is found in Java Doxygen tests
Don't pass null pointer to BufferedWriter.write(), as this results in NullPointerException.
This commit is contained in:
parent
fe6968e5e2
commit
5a8875ca9d
1 changed files with 2 additions and 1 deletions
|
|
@ -99,7 +99,8 @@ public class CommentParser {
|
||||||
try {
|
try {
|
||||||
// write expected string to file
|
// write expected string to file
|
||||||
BufferedWriter expectedFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(expectedFileName)));
|
BufferedWriter expectedFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(expectedFileName)));
|
||||||
expectedFile.write(wantedStr);
|
if (wantedStr != null)
|
||||||
|
expectedFile.write(wantedStr);
|
||||||
expectedFile.close();
|
expectedFile.close();
|
||||||
|
|
||||||
// write translated string to file
|
// write translated string to file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue