Bug? BBCodeView throws exception if text is enclosed in square brackets (and considered an invalid tag)

walt61

Active Member
Licensed User
Longtime User
See subject and attached demo project. If BBCodeView1.Text is set to some string that contains square brackets but these don't enclose a valid tag, an exception is thrown and the BBCodeView becomes empty and further unusable (further attempts to set the text result in more RuntimeExceptions). The log shows (when "[MyText]" was added):
Error (position - 0): Invalid tag: MyText
(RuntimeException) java.lang.RuntimeException: Object should first be initialized (List).

Perhaps is an invalid tag is encountered, it should be considered as plain text.

I've only tested this with B4J; perhaps it is a B4X-wide issue?
 

Attachments

  • BBCodeViewError.zip
    3 KB · Views: 111

walt61

Active Member
Licensed User
Longtime User
So be it. Just some background info: the offending text was something I received, not something I created myself - and hadn't noticed the tags (at least not before @stevel05 mentioned them).

Just a suggestion (use it or lose it): if error message "[B]Error[/B] (position - 0): Invalid tag: MyText" would be changed to "[B]BBCodeView Error[/B] (position - 0): Invalid tag: MyText", I'd have spotted it sooner.
 
Top