Fix LT-22520: Crash when closing Find dialog in Grammar Sketch#882
Conversation
|
I took a look at the code and have a few thoughts:
On: FieldWorks/Src/xWorks/GeneratedHtmlViewer.cs Lines 1038 to 1039 in 10d71d1 I did a code search and there could also be similar issues at these locations. I don't know if they are risks or not. we could always open up a JIRA issue to address later if need be: 2: GeneratedHtmlViewer.cs:1088 3: GeneratedHtmlViewer.cs:1123 4: GeneratedHtmlViewer.cs:1151 5: TryAWordDlg.cs:387 |
|
I think the code addresses the core issue - I am just wondering which is the most robust way to handle it. We could prevent the Find UI from coming up (probably the best way), but that is a greater scope creep. |
|
This is low priority, since users rarely invoke Find before generating a sketch. This code is good enough to avoid a crash, and simple enough to verify that it won't introduce any new bugs. |
|
I agree - it's not as clean as I would like, but it fixes it. The comment is clear enough - the check is for before data is loaded. |
This fixes https://jira.sil.org/browse/LT-22520. If you try to find something before a sketch has been generated, you get an error. Ideally, we would suppress the Find menu item in this case, but I wasn't sure that I could get that right in all cases. So now if you click on the Find menu item, nothing happens. This isn't perfect, but at least it doesn't crash. This is also pretty uncommon.
This change is