The below code produces error: 'Object reference not set to an instance of an object' in B4J 5.5
If I modify the line into:
There is no error.
B4X:
Public Sub NavigateToPage(WebSocketObject As WebSocket, PageId As String, TargetUrl As String)
If Version.Length > 0 Then TargetUrl = $"${TargetUrl}?${Version}"$ ' <-- This line produces the error
If PageId.Length > 0 Then ABM.RemoveMeFromCache(CachedPages, PageId)
If WebSocketObject.Open Then
If Settings.BrowserKeepsNavigationHistory Then
' it keeps the navigation history in the browser
WebSocketObject.Eval("window.location = arguments[0]", Array As Object(TargetUrl))
Else
' it doesn't keep navigation history in the browser (the back button exists the application)
WebSocketObject.Eval("window.location.replace(arguments[0])", Array As Object(TargetUrl))
End If
WebSocketObject.Flush
End If
End Sub
If I modify the line into:
B4X:
If Version.Length > 0 Then
TargetUrl = $"${TargetUrl}?${Version}"$
End If