Skip to content

Instantly share code, notes, and snippets.

@sonOfRa
Created September 19, 2013 19:02
Show Gist options
  • Save sonOfRa/6628275 to your computer and use it in GitHub Desktop.
Save sonOfRa/6628275 to your computer and use it in GitHub Desktop.
public static String getByteString(byte[] in) throws ToxException {
try {
if (in == null) {
return "";
}
System.out.println(in.length); // This is line 1399
return new String(in, "UTF-8");
} catch (UnsupportedEncodingException e) {
ToxException e1 = new ToxException(ToxError.TOX_UNKNOWN);
e1.initCause(e);
throw e1;
}
}
Exception in thread "Thread-0" java.lang.NullPointerException
at im.tox.jtoxcore.JTox.getByteString(JTox.java:1399)
at im.tox.jtoxcore.test.TestOnFriendRequestCallback.execute(TestOnFriendRequestCallback.java:20)
at im.tox.jtoxcore.JTox.tox_do(Native Method)
at im.tox.jtoxcore.JTox.doTox(JTox.java:377)
at im.tox.jtoxcore.ToxWorker.run(ToxWorker.java:71)
at java.lang.Thread.run(Thread.java:724)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment