summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docview/src/frm_main.pas14
1 files changed, 12 insertions, 2 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas
index e3617bd3..3c0590b5 100644
--- a/docview/src/frm_main.pas
+++ b/docview/src/frm_main.pas
@@ -3338,6 +3338,7 @@ procedure TMainForm.ProcessCommandLineParams;
var
showtopic: boolean;
t: TTopic;
+ n: integer;
begin
if ParamCount > 0 then
begin
@@ -3368,8 +3369,17 @@ begin
else if gCommandLineParams.IsParam('n') then
begin
{ Display topic with numeric topic id }
- t := FindTopicByResourceID(StrToInt(gCommandLineParams.GetParam('n')));
- DisplayTopic(t);
+ try
+ n := StrToInt(gCommandLineParams.GetParam('n'));
+ t := FindTopicByResourceID(n);
+ DisplayTopic(t);
+ except
+ on EConvertError do
+ begin
+ TfpgMessageDialog.Critical('Invalid Parameter Value',
+ '<' + gCommandLineParams.GetParam('n') + '> is not an number.');
+ end;
+ end;
end
else if gCommandLineParams.IsParam('s') then
begin