Closed hansemannn closed 2 years ago
Looking at this source, it seems like declaringClass
can be null.
I think I over-engineered a part of the implementation.
Instead of:
if (splitByParen[0].indexOf(splitByParen[1].split("\\.")[0]) > -1) {
declaringClass = splitByParen[0].substring(0, splitByParen[0].indexOf(splitByParen[1].split("\\.")[0]) - 1).trim();
methodName = splitByParen[0].substring(splitByParen[0].indexOf(splitByParen[1].split("\\.")[0]));
} else {
declaringClass = splitByParen[0].substring(0, splitByParen[0].lastIndexOf('.')).trim();
methodName = splitByParen[0].substring(splitByParen[0].lastIndexOf('.') + 1);
}
It really can be just what's in the else:
declaringClass = splitByParen[0].substring(0, splitByParen[0].lastIndexOf('.')).trim();
methodName = splitByParen[0].substring(splitByParen[0].lastIndexOf('.') + 1);
You are going to get the same result in the firebase console either way.
and just for good measure, I will add:
if (declaringClass == null) {
declaringClass = "unknown";
}
if (methodName == null) {
methodName = "unknown";
}
The changes from @petenathan42 were great! But unfortunately, we now see some crashes with the following stack trace. It seems like Intercom also influences this.