We ran into a crash issue that we traced to an uncaught exception in UIReferenceImplementation.
The error is "java.lang.NullPointerException: Attempt to get length of null array" in the first line of SmartGuideView's computeModificationOfWords.
It would appear that the function is being called with oldWords set to null, causing the exception when it tries to get the length of oldWords with
int len1 = oldWords.length;
We caught this error after randomly using iink for about 30 minutes, so we unfortunately don't have a sure method to reproduce it for now.
Do you have any suggestion to deal with this issue?
Thank you!
Best Answer
O
Olivier @MyScript
said
about 3 years ago
Dear Nicolas,
thank you for all the information.
What is puzzling is that there is normally no reason the "oldWords" variable of the computeModificationOfWords woudl be null, and I am afraid we would not be able to reproduce.
I just did few tries on my side, and a quick workaround I came up with is simply to check the oldWords variable, and if the latter is null, simply return.
private void computeModificationOfWords(SmartGuideWord[] words, SmartGuideWord[] oldWords)
{
if(oldWords==null)
{
return;
}...
Normally, the "words" global variable should be re-updated later, and thus there should not have any major impact.
Indeed, after checking our bug tracker tool, 2 issues with error message "Attempt to get length of null array" have already been raised, and solved. Having the full error message will allow us to know if the issue is solved or if it is a new one. If a new one, an exact scenario would be of help.
Best regards,
Olivier
N
Nicolas Morin
said
about 3 years ago
Thank you Olivier.
Here is the full log. I edited out the package name to keep the privacy of our client.
E/AndroidRuntime: FATAL EXCEPTION: Thread-57232 Process: com.a.a, PID: 653 java.lang.NullPointerException: Attempt to get length of null array at com.myscript.iink.uireferenceimplementation.SmartGuideView.computeModificationOfWords(SmartGuideView.java:625) at com.myscript.iink.uireferenceimplementation.SmartGuideView.update(SmartGuideView.java:530) at com.myscript.iink.uireferenceimplementation.SmartGuideView.contentChanged(SmartGuideView.java:377) at com.myscript.iink.Editor$3.accept(Editor.java:152) at com.myscript.iink.Editor$3.accept(Editor.java:148) at com.myscript.iink.ListenerList.forEach(ListenerList.java:50) at com.myscript.iink.Editor.contentChanged(Editor.java:147)
We are using version 1.4.1 of UIReferenceImplementation and iink SDK from github.
O
Olivier @MyScript
said
about 3 years ago
Answer
Dear Nicolas,
thank you for all the information.
What is puzzling is that there is normally no reason the "oldWords" variable of the computeModificationOfWords woudl be null, and I am afraid we would not be able to reproduce.
I just did few tries on my side, and a quick workaround I came up with is simply to check the oldWords variable, and if the latter is null, simply return.
private void computeModificationOfWords(SmartGuideWord[] words, SmartGuideWord[] oldWords)
{
if(oldWords==null)
{
return;
}...
Normally, the "words" global variable should be re-updated later, and thus there should not have any major impact.
Let me know if this helps on your side.
Best regards,
Olivier
N
Nicolas Morin
said
about 3 years ago
> Indeed, after checking our bug tracker tool, 2 issues with error message
"Attempt to get length of null array" have already been raised, and
solved.
Regarding the previous issues. You said those issues have been solved, but are the fixes included in version 1.4.1 of the iink SDK for Android?
Nicolas Morin
We ran into a crash issue that we traced to an uncaught exception in UIReferenceImplementation.
The error is "java.lang.NullPointerException: Attempt to get length of null array" in the first line of SmartGuideView's computeModificationOfWords.
It would appear that the function is being called with oldWords set to null, causing the exception when it tries to get the length of oldWords with
int len1 = oldWords.length;
We caught this error after randomly using iink for about 30 minutes, so we unfortunately don't have a sure method to reproduce it for now.
Do you have any suggestion to deal with this issue?
Thank you!
Dear Nicolas,
thank you for all the information.
What is puzzling is that there is normally no reason the "oldWords" variable of the computeModificationOfWords woudl be null, and I am afraid we would not be able to reproduce.
I just did few tries on my side, and a quick workaround I came up with is simply to check the oldWords variable, and if the latter is null, simply return.
Let me know if this helps on your side.
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstOlivier @MyScript
Dear Nicolas,
thank you for contacting us.
Do you happen to have the full logcat?
Indeed, after checking our bug tracker tool, 2 issues with error message "Attempt to get length of null array" have already been raised, and solved. Having the full error message will allow us to know if the issue is solved or if it is a new one. If a new one, an exact scenario would be of help.
Best regards,
Olivier
Nicolas Morin
Thank you Olivier.
Here is the full log. I edited out the package name to keep the privacy of our client.
E/AndroidRuntime: FATAL EXCEPTION: Thread-57232
Process: com.a.a, PID: 653
java.lang.NullPointerException: Attempt to get length of null array
at com.myscript.iink.uireferenceimplementation.SmartGuideView.computeModificationOfWords(SmartGuideView.java:625)
at com.myscript.iink.uireferenceimplementation.SmartGuideView.update(SmartGuideView.java:530)
at com.myscript.iink.uireferenceimplementation.SmartGuideView.contentChanged(SmartGuideView.java:377)
at com.myscript.iink.Editor$3.accept(Editor.java:152)
at com.myscript.iink.Editor$3.accept(Editor.java:148)
at com.myscript.iink.ListenerList.forEach(ListenerList.java:50)
at com.myscript.iink.Editor.contentChanged(Editor.java:147)
We are using version 1.4.1 of UIReferenceImplementation and iink SDK from github.
Olivier @MyScript
Dear Nicolas,
thank you for all the information.
What is puzzling is that there is normally no reason the "oldWords" variable of the computeModificationOfWords woudl be null, and I am afraid we would not be able to reproduce.
I just did few tries on my side, and a quick workaround I came up with is simply to check the oldWords variable, and if the latter is null, simply return.
Let me know if this helps on your side.
Best regards,
Olivier
Nicolas Morin
> Indeed, after checking our bug tracker tool, 2 issues with error message "Attempt to get length of null array" have already been raised, and solved.
Regarding the previous issues. You said those issues have been solved, but are the fixes included in version 1.4.1 of the iink SDK for Android?
Thank you!
Olivier @MyScript
Dear Nicolas,
yes, I confirm the fixes are in the 1.4.1.
It is likley you are facing another behavior.
Best regards,
Olivier
1 person likes this