Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“NullPointerException”The number passed in the api is formatStackTrace is a null pointer. #2784

Open
Cici-Musse-Lee opened this issue May 31, 2022 · 0 comments

Comments

@Cici-Musse-Lee
Copy link

The file path is org.zkoss.lang.Exceptions
"java.lang.Throwable.printStackTrace(java.io.PrintWriter)"because "t"is null
source code:

public static final StringBuffer formatstackTrace(StringBuffer sb,Throwable t,String prefix,int maxcnt){
        final stringWriter sw new stringWriter();
        t.printstackTrace(new Printwriter(sw));
        final stringBuffer trace sw.getBuffer();
}

test code:

public void test_formatStackTrace_5_80()throws NoSuchFieldException,IllegalAccessException{
        java.lang.Throwable throwable0 null;
        java.lang.String string1 ="ftp://fhBD.wOJdSb.L.H63.4Hh.UxcBz.oGNV";
        org.zkoss.lang.Exceptions.formatstackTrace(throwable0,string1);
}

test result:

java.lang.NullPointerException:Cannot invoke "java.lang.Throwable.printStackTrace(java.io.PrintWriter)"because "t"is null
at org.zkoss.lang.Exceptions.formatStackTrace(Exceptions.java:418)
at org.zkoss.lang.Exceptions.formatStackTrace(Exceptions.java:400)
at org.zkoss.lang.Exceptions.formatStackTrace(Exceptions.java:390)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant