I got the following Java Error...
java.lang.NullPointerException: Attempt to invoke virtual method 'int uk.co.martinpearman.b4a.webkit.WebBackForwardList.GetCurrentIndex()' on a null object reference
I have received this type of Nil exception error a number of times for various random reasons on various methods. I think it best I setup guards to prevent random program crashes.
How do I setup a "Nil Guard" something like:
java.lang.NullPointerException: Attempt to invoke virtual method 'int uk.co.martinpearman.b4a.webkit.WebBackForwardList.GetCurrentIndex()' on a null object reference
I have received this type of Nil exception error a number of times for various random reasons on various methods. I think it best I setup guards to prevent random program crashes.
How do I setup a "Nil Guard" something like:
B4X:
Pseudo Code:
if myObject <> nil Then
'Do stuff with myObject
End If