Wintermute Engine Forum

Wintermute Engine => Bug reports => Fixed => Topic started by: MMR on April 01, 2008, 11:24:26 AM

Title: Bug in WindowEdit v1.8.5
Post by: MMR on April 01, 2008, 11:24:26 AM
When you try to open a file and you cancel the "Open File" window it shows a "Error opening file" window.
Title: Re: Bug in WindowEdit v1.8.5
Post by: Net on April 01, 2008, 06:54:22 PM
I think it's because in WME code there is called sequence like this (eg. in Object Pascal):

procedure OpenButton.OnClick(Sender: TObject);
begin
  OpenDialog.Execute;
  Window.Name:= OpenDialog.FileName;
end;

so when you close the OpenDialog window (by pressing CLOSE button), the variable Window.Name can't be set, because OpenDialog.FileName is not set and throws the error.

It can be avoided by using something like this:

if OpenDialog.Execute then
begin
  Window.Name:= OpenDialog.FileName;
end;

this code controls, if in OpenDialog was opened some file, else the code inside is not launched.


I think that Mnemonic just overlook this  ;)
Title: Re: Bug in WindowEdit v1.8.5
Post by: MMR on April 01, 2008, 09:38:21 PM
I think it's very very easy to solve  ;) it's some kind of oversight by Mnemonic but nevertheless it would be good to fix  ::)