summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-12 06:43:03 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-12 06:43:03 +0200
commiteed83717b6125ba655be9ffd618f301ef97948b2 (patch)
tree8ff31be25370904bbe4a428b0b759f7a84b8e52a
parent531d64d880026e76836d15fc80adefd729c06281 (diff)
Fixed crash if "open" command has no "url"
IssueID #385
-rw-r--r--src/app.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 63a286f8..148bba52 100644
--- a/src/app.c
+++ b/src/app.c
@@ -2626,7 +2626,11 @@ iBool handleCommand_App(const char *cmd) {
2626 return iTrue; 2626 return iTrue;
2627 } 2627 }
2628 else if (equal_Command(cmd, "open")) { 2628 else if (equal_Command(cmd, "open")) {
2629 iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url")); 2629 const char *urlArg = suffixPtr_Command(cmd, "url");
2630 if (!urlArg) {
2631 return iTrue; /* invalid command */
2632 }
2633 iString *url = collectNewCStr_String(urlArg);
2630 const iBool noProxy = argLabel_Command(cmd, "noproxy") != 0; 2634 const iBool noProxy = argLabel_Command(cmd, "noproxy") != 0;
2631 const iBool fromSidebar = argLabel_Command(cmd, "fromsidebar") != 0; 2635 const iBool fromSidebar = argLabel_Command(cmd, "fromsidebar") != 0;
2632 iUrl parts; 2636 iUrl parts;