Skip to content

Commit 84b70de

Browse files
fix: error string out of range
if FormText is empty there is no FormText[1]
1 parent e86563a commit 84b70de

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

source/code/main.lfm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,4 @@ object FormTrackerModify: TFormTrackerModify
365365
end
366366
end
367367
end
368-
object MainMenu1: TMainMenu
369-
left = 360
370-
top = 12
371-
end
372368
end

source/code/main.pas

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ TFormTrackerModify = class(TForm)
3434
GroupBoxNewTracker: TGroupBox;
3535
GroupBoxPresentTracker: TGroupBox;
3636
MainMenu: TMainMenu;
37-
MainMenu1: TMainMenu;
3837
MemoNewTrackers: TMemo;
3938
MenuFile: TMenuItem;
4039
MenuFileTorrentFolder: TMenuItem;
@@ -320,9 +319,13 @@ procedure TFormTrackerModify.MenuItemOnlineCheckSubmitNewTrackonClick(Sender: TO
320319
TrackerSendCount: integer;
321320
PopupStr: string;
322321
begin
323-
324-
SendStatus := FControlerTrackerListOnline.SubmitTrackers(
325-
FTrackerList.TrackerFromInsideTorrentFilesList, TrackerSendCount);
322+
try
323+
screen.Cursor := crHourGlass;
324+
SendStatus := FControlerTrackerListOnline.SubmitTrackers(
325+
FTrackerList.TrackerFromInsideTorrentFilesList, TrackerSendCount);
326+
finally
327+
screen.Cursor := crDefault;
328+
end;
326329

327330
if SendStatus then
328331
begin
@@ -397,7 +400,10 @@ procedure TFormTrackerModify.ShowUserErrorMessage(const ErrorText: string;
397400
end
398401
else
399402
begin
400-
Application.MessageBox(PChar(@ErrorText[1]), PChar(@FormText[1]), MB_ICONERROR);
403+
if FormText = '' then
404+
Application.MessageBox(PChar(@ErrorText[1]), '', MB_ICONERROR)
405+
else
406+
Application.MessageBox(PChar(@ErrorText[1]), PChar(@FormText[1]), MB_ICONERROR);
401407
end;
402408
end;
403409

0 commit comments

Comments
 (0)