dome
dome copied to clipboard
Silent crash with invalid string
I was getting a crash in dome where there was no error dialog and nothing in the log, the window just didn't open.
After adding many debug log messages I managed to track it down to me having accidentally passed an image file to some string manipulation code.
Recreation in dome:
// load image as text
var text = FileSystem.load("background.png")
Log.info("before") // this log message DOES appear in the dome log
var newText = text.replace("\r", "")
Log.info("after") // this log message DOES NOT appear in the dome log
This actual error occurred in my xml library, so I tested with wren_cli, but the error did not occur.
In wren_cli:
var text = File.read("background.png")
System.print("before")
var newText = text.replace("\r", "")
System.print("after") // this log message DOES appear in the console
// ... then it goes on to abort as usual in wren because it's an invalid xml document
For reference, I'm using dome 1.8.2 on Windows and this is the image I was doing this with: https://github.com/Deijin27/wren-xsequence/blob/master/test_data/test_image.png