Picture is Nil on Linux standalone app

I have a webapp that runs fine on my Mac, and was working on my Linux server.

I added a cellpicture to a listbox so I could show status as red, green, or yellow circles. Works fine on the mac. On my linux server I get one of those error boxes that pops up with the stack. It clearly seems to be failing to draw the pictures. They are just .png files I dragged into my project, and they did get uploaded to the server in the resources folder.

I’m not sure why the appicon png files would show up fine when my app is loading, but my pngs do not. Is there some library dependency? Do I need to load something on the server?

Here’s the error text.

RaiseNilObjectException
ListBoxImageCell.StringValue%s%o
WebListBox.=CellObject%%oi8i8o
WebListBox.=CellPicture%%oi8i8o

So I came up with a work around that also works fine on the mac, but not on linux. I pulled this code from another weblistbox picture thread.

  [code]dim st() As String
  
  st.append("var tbody = document.getElementById('" + lbTargets.controlID + "').getElementsByTagName('table')[1].getElementsByTagName('tbody')[0];")
  st.append("var cell = tbody.getElementsByTagName('tr')["+str(i)+"].getElementsByTagName('td')["+str(0)+"];")
  st.append("if (cell) {")
  'st.Append("cell.innerHTML=""<img src='framework/greencircle.png'/>"";")
  st.Append("cell.innerHTML=""G"";")
  st.append("}")
  
  ExecuteJavaScript(Join(st))[/code]

The image didn’t show up on linux, so I tried just a letter G. That also doesn’t show up. Both work fine when debugging on the mac.

At least I’m no longer getting an error box when I load the app from the linux server, but still, what gives? I’m stumped.

Can you strip down the example that doesn’t work and file a bug report?

Also make sure the file names are the same case. Linux is case-sensitive where macOS is usually not.

It turns out I was causing the nil myself by trying to remove a picture from a cell that didn’t have a picture. So that’s another question I have. How do you remove a cellpicture in a weblistbox?

Anyway, the bug is totally different than what I initially thought. The problem is that on linux the dictionary haskey doesn’t seem to be working. In the snippet below, on the Mac I always get the host ip logged, which is what it’s pulling from the listbox cell. Something like 10.0.10.1. This also happens on linux. On the Mac, the next log statement is “has host”. On linux I just get the next host ip address. It doesn’t find the host in my dictionary. Since I don’t have a full linux desktop to run the IDE on I’ll have to figure out how to pair down the example before I submit it. But this is happening in the latest beta as well so I’ll try to get it done tomorrow and submit. It would be nice to have this fixed whatever it is.

for i = 0 to j host = lbTargets.Cell(i,3) system.DebugLog(host) if app.shellPool.HasKey(host) then system.DebugLog("has host")

Try as I might to reduce this to a simple app, I couldn’t. I went ahead and submitted a pared down version of the rebuilt app in a feedback report. Hopefully someone at Xojo can see what is going wrong. It’s got me boggled.

I may have to simply strip the dictionary from the app and try some other structure.

It’s 48979

I was able to do some debugging before my app segfaults while stepping through code. It appears that there are no keys at all in the dictionary on the linux box. I am unable to step through the code that adds the keys because of the segfault while debugging, but I’ll try to focus on the dictionary now and see what I can figure out. I did use a dictionary in my test app before and it seemed to work fine, so I’ll have to see if I can figure out any other factors that could be contributing.

Problem appears to be some difference between the platforms in another section of code that was causing an error in a db update which in turn was removing the items in the dictionary. Once I was able to get through a few debugging sessions I was able to track it down to an earlier part of my code. Unfortunately I am not sure of the exact difference yet because the debug app segfaults for some reason in the method that contains the code which was indirectly causing the db update error.

I changed my db update code so the error doesn’t trigger the bad removal from the dictionary. I’ll debug it further later once the remote debugger issue is fixed or I get enough gumption to load a desktop version of linux and run the ide there. For now the problem is solved. Sorry for the waste of bandwidth.