Closed ueen closed 3 years ago
I believe this is not a random crash. I updated TableNameUtil.checkTableName
javadoc to state that it throws an IllegalArgumentException
when the table name is not valid (according to LO limitations):
A valid table name should not start with a single quote (
'
) or contain of of the following characters: left square bracket ([
), right square bracket (]
), star (*
), question mark (?
), colon (:
), slash (/
) or backslash (\
).
Maybe your args.filmtitle
contains one of these characters (colons or question marks are frequent in film titles).
I will think of providing a TableNameUtil.sanitizeTableName
method to simply replace those chars with a space.
Thats a bright idea! Can those characters be escaped somehow?
I just added the method to TableNameUtil
. If you want to sanitize the table name (e.g. when it's not a literal but comes from a foreign source, like a user input, a database...), you can write:
val name = TableNameUtil().sanitizeTableName(args.filmtitle)
val table = document.addTable(name)
Awesome! Can you foster a release so I can get it via jitpack?
I pushed the new version this evening. Will be available on maven central soon.
Android 8.1 (Redmi S2) Just received this crash, does this ring any bells?
thats my code works on Android 10/11 in my testing on an Smsung A40
If you have no idea, please close, somtimes there are just random crahes, due to the specific device and its software implementations.