mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-25 15:52:06 +01:00
Make ExceptionUtil.getStackTrace(Throwable) null safe
This commit is contained in:
parent
01289e9682
commit
870e6c674a
1 changed files with 4 additions and 0 deletions
|
@ -22,6 +22,10 @@ import java.io.StringWriter;
|
||||||
public class ExceptionUtil {
|
public class ExceptionUtil {
|
||||||
|
|
||||||
public static String getStackTrace(Throwable throwable) {
|
public static String getStackTrace(Throwable throwable) {
|
||||||
|
if (throwable == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
StringWriter stringWriter = new StringWriter();
|
StringWriter stringWriter = new StringWriter();
|
||||||
PrintWriter printWriter = new PrintWriter(stringWriter);
|
PrintWriter printWriter = new PrintWriter(stringWriter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue