Crash when trying to analyze with non-existing New Engine
Chess Database and PGN viewer
Brought to you by:
hognose
In Edit->Preferences->Engines a new engine can be added just clicking on the button New and then on Ok.
This adds a non-existing New Engine, that however is listed in the Analysis window. If such New Engine is selected and the button Analyze is clicked, ChessX crashes.
The way engines are added is changed, so now it is much more difficult to inadvertently add a non-existing engine. Still, if one deletes by mistake the Command field in Preferences, still ChessX crashes trying to make a non-existing engine run.
Can't reproduce it, although I can observe crash when manually killing engine process outside ChessX.
Crashes when engines are manually killed do not happen in Windows. Even if they were, i would not consider that a real bug, because unpredictable behavior may be expected for such operations performed "outside" the program window.
At the moment, ChessX happily accepts an empty string for both command path and engine name. Thus, the bug can be easily solved by not accepting empty strings there, for instance not enabling the OK button until those fields are filled.
Note that no further checks are needed on the strings provided. In fact, even if a "wrong" file is selected in the command path (C:/User/manual.pdf, for instance), there will be no output (of course) in the Analysis window, but ChessX won't crash. And this is entirely acceptable behavior.