From f70c1046ca9b82c9135062e855166a9d8a1180b8 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 11:09:54 +0100 Subject: [PATCH 1/8] fix: execute sql parameter parsing --- example/gauge/Components/Pages/Test/Test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index 5a502efb..947d1a8c 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -19,7 +19,7 @@ interface FunctionDescriptor { index: number; arguments: string[]; name: string; - functionCallback: (input?: string, inputAlt?: string) => Promise; + functionCallback: (input: string, inputAlt: string) => Promise; } interface InputState { @@ -206,7 +206,7 @@ export class TestPage extends DisplayComponent { functionCallback: (input, inputAlt) => this.props.interface.execute_sql( input ?? "", - inputAlt?.replace("[", "").replace("]", "").replace('"', "").split(",") ?? [], + JSON.parse(inputAlt.length > 0 ? inputAlt : "[]"), ), }, { From a9eedad59b265b1ecd58d238cc62a4b8dcddc00b Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 11:22:31 +0100 Subject: [PATCH 2/8] fix: all usages of input and inputAlt --- example/gauge/Components/Pages/Test/Test.tsx | 62 +++++++++----------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index 947d1a8c..9c082677 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -39,7 +39,7 @@ export class TestPage extends DisplayComponent { index: 0, arguments: ["url: string"], name: "DownloadNavigationData", - functionCallback: input => this.props.interface.download_navigation_data(input ?? ""), + functionCallback: input => this.props.interface.download_navigation_data(input), }, { index: 1, @@ -51,153 +51,153 @@ export class TestPage extends DisplayComponent { index: 2, arguments: ["ident: string"], name: "GetAirport", - functionCallback: input => this.props.interface.get_airport(input ?? ""), + functionCallback: input => this.props.interface.get_airport(input), }, { index: 3, arguments: ["ident: string"], name: "GetWaypoints", - functionCallback: input => this.props.interface.get_waypoints(input ?? ""), + functionCallback: input => this.props.interface.get_waypoints(input), }, { index: 4, arguments: ["ident: string"], name: "GetVhfNavaids", - functionCallback: input => this.props.interface.get_vhf_navaids(input ?? ""), + functionCallback: input => this.props.interface.get_vhf_navaids(input), }, { index: 5, arguments: ["ident: string"], name: "GetNdbNavaids", - functionCallback: input => this.props.interface.get_ndb_navaids(input ?? ""), + functionCallback: input => this.props.interface.get_ndb_navaids(input), }, { index: 6, arguments: ["ident: string"], name: "GetAirways", - functionCallback: input => this.props.interface.get_airways(input ?? ""), + functionCallback: input => this.props.interface.get_airways(input), }, { index: 7, arguments: ["fixIdent: string", "fixIcao: string"], name: "GetAirwaysAtFix", - functionCallback: (input, inputAlt) => this.props.interface.get_airways_at_fix(input ?? "", inputAlt ?? ""), + functionCallback: (input, inputAlt) => this.props.interface.get_airways_at_fix(input, inputAlt), }, { index: 8, arguments: ["center: (lat, long)", "range: nm"], name: "GetAirportsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_airports_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_airports_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 9, arguments: ["center: (lat, long)", "range: nm"], name: "GetWaypointsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_waypoints_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_waypoints_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 10, arguments: ["center: (lat, long)", "range: nm"], name: "GetVhfNavaidsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_vhf_navaids_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_vhf_navaids_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 11, arguments: ["center: (lat, long)", "range: nm"], name: "GetNdbNavaidsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_ndb_navaids_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_ndb_navaids_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 12, arguments: ["center: (lat, long)", "range: nm"], name: "GetAirwaysInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_airways_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_airways_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 13, arguments: ["center: (lat, long)", "range: nm"], name: "GetControlledAirspacesInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_controlled_airspaces_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_controlled_airspaces_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 14, arguments: ["center: (lat, long)", "range: nm"], name: "GetRestrictiveAirspacesInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_restrictive_airspaces_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_restrictive_airspaces_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 15, arguments: ["center: (lat, long)", "range: nm"], name: "GetCommunicationsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_communications_in_range(this.strToCoords(input), Number(inputAlt ?? 0)), + this.props.interface.get_communications_in_range(this.strToCoords(input), Number(inputAlt || 0)), }, { index: 16, arguments: ["airportIdent: string"], name: "GetRunwaysAtAirport", - functionCallback: input => this.props.interface.get_runways_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_runways_at_airport(input), }, { index: 17, arguments: ["airportIdent: string"], name: "GetDeparturesAtAirport", - functionCallback: input => this.props.interface.get_departures_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_departures_at_airport(input), }, { index: 18, arguments: ["airportIdent: string"], name: "GetArrivalsAtAirport", - functionCallback: input => this.props.interface.get_arrivals_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_arrivals_at_airport(input), }, { index: 19, arguments: ["airportIdent: string"], name: "GetApproachesAtAirport", - functionCallback: input => this.props.interface.get_approaches_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_approaches_at_airport(input), }, { index: 20, arguments: ["airportIdent: string"], name: "GetWaypointsAtAirport", - functionCallback: input => this.props.interface.get_waypoints_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_waypoints_at_airport(input), }, { index: 21, arguments: ["airportIdent: string"], name: "GetNdbNavaidsAtAirport", - functionCallback: input => this.props.interface.get_ndb_navaids_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_ndb_navaids_at_airport(input), }, { index: 22, arguments: ["airportIdent: string"], name: "GetGatesAtAirport", - functionCallback: input => this.props.interface.get_gates_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_gates_at_airport(input), }, { index: 23, arguments: ["airportIdent: string"], name: "GetCommunicationsAtAirport", - functionCallback: input => this.props.interface.get_communications_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_communications_at_airport(input), }, { index: 24, arguments: ["airportIdent: string"], name: "GetGlsNavaidsAtAirport", - functionCallback: input => this.props.interface.get_gls_navaids_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_gls_navaids_at_airport(input), }, { index: 25, arguments: ["airportIdent: string"], name: "GetPathPointsAtAirport", - functionCallback: input => this.props.interface.get_path_points_at_airport(input ?? ""), + functionCallback: input => this.props.interface.get_path_points_at_airport(input), }, { index: 26, @@ -205,8 +205,8 @@ export class TestPage extends DisplayComponent { name: "ExecuteSQLQuery", functionCallback: (input, inputAlt) => this.props.interface.execute_sql( - input ?? "", - JSON.parse(inputAlt.length > 0 ? inputAlt : "[]"), + input, + (JSON.parse(inputAlt || "[]") as unknown[]).map(v => String(v)), // Try to parse the argument as a JSON formatted array, falling back to an empty array if needed. We also force all values to strings since that is what the backend expects ), }, { @@ -240,12 +240,8 @@ export class TestPage extends DisplayComponent { this.input2State, ); - private strToBool(input?: string): boolean { - return input == "true" ? true : false; - } - - private strToCoords(input?: string): Coordinates { - const splitInput = (input ?? "").replace(/[(){}\s]/g, "").split(","); + private strToCoords(input: string): Coordinates { + const splitInput = input.replace(/[(){}\s]/g, "").split(","); const coords: Coordinates = { lat: Number(splitInput[0] ?? 0.0), From 83d6d7a509652f3f3aaebeb9c12e0f7ba3a6e5cb Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 12:49:11 +0100 Subject: [PATCH 3/8] fix: wrap in try --- example/gauge/Components/Pages/Test/Test.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index 9c082677..8d69efa2 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -203,11 +203,17 @@ export class TestPage extends DisplayComponent { index: 26, arguments: ["sql: string", "params: string[]"], name: "ExecuteSQLQuery", - functionCallback: (input, inputAlt) => - this.props.interface.execute_sql( - input, - (JSON.parse(inputAlt || "[]") as unknown[]).map(v => String(v)), // Try to parse the argument as a JSON formatted array, falling back to an empty array if needed. We also force all values to strings since that is what the backend expects - ), + functionCallback: (input, inputAlt) => { + // Try to parse the argument as a JSON formatted array, falling back to an empty array if needed. We also force all values to strings since that is what the backend expects + let argsList: string[] = []; + try { + argsList = (JSON.parse(inputAlt) as unknown[]).map(v => String(v)); + } catch { + //noop + } + + return this.props.interface.execute_sql(input, argsList); + }, }, { index: 27, From 5a4e366ba2be252cb09d4fcc41060400f88143b7 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 13:11:22 +0100 Subject: [PATCH 4/8] chore: add console error --- example/gauge/Components/Pages/Test/Test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index 8d69efa2..4bc90750 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -208,7 +208,8 @@ export class TestPage extends DisplayComponent { let argsList: string[] = []; try { argsList = (JSON.parse(inputAlt) as unknown[]).map(v => String(v)); - } catch { + } catch (e) { + console.error(`Error parsing argument input: ${e}. Falling back to empty list`); //noop } From 8f4966a792bd1bdba12f159e5b79bb66f7179a31 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 13:11:30 +0100 Subject: [PATCH 5/8] remove comment --- example/gauge/Components/Pages/Test/Test.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index 4bc90750..fab53839 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -210,7 +210,6 @@ export class TestPage extends DisplayComponent { argsList = (JSON.parse(inputAlt) as unknown[]).map(v => String(v)); } catch (e) { console.error(`Error parsing argument input: ${e}. Falling back to empty list`); - //noop } return this.props.interface.execute_sql(input, argsList); From 81b9d2c569c06dcd86f30949cb6bccddb25c9fb0 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 14:05:12 +0100 Subject: [PATCH 6/8] fix: make sure parsed json is array --- example/gauge/Components/Pages/Test/Test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index fab53839..24811108 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -207,7 +207,8 @@ export class TestPage extends DisplayComponent { // Try to parse the argument as a JSON formatted array, falling back to an empty array if needed. We also force all values to strings since that is what the backend expects let argsList: string[] = []; try { - argsList = (JSON.parse(inputAlt) as unknown[]).map(v => String(v)); + const parsed = JSON.parse(inputAlt); + argsList = Array.isArray(parsed) ? parsed.map(v => String(v)) : []; } catch (e) { console.error(`Error parsing argument input: ${e}. Falling back to empty list`); } From 15b63f89ca9063a59e0356167c1f4c6b34be7693 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 14:06:46 +0100 Subject: [PATCH 7/8] fix: only parse json if string is not empty --- example/gauge/Components/Pages/Test/Test.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index 24811108..ca02bf8e 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -206,11 +206,13 @@ export class TestPage extends DisplayComponent { functionCallback: (input, inputAlt) => { // Try to parse the argument as a JSON formatted array, falling back to an empty array if needed. We also force all values to strings since that is what the backend expects let argsList: string[] = []; - try { - const parsed = JSON.parse(inputAlt); - argsList = Array.isArray(parsed) ? parsed.map(v => String(v)) : []; - } catch (e) { - console.error(`Error parsing argument input: ${e}. Falling back to empty list`); + if (inputAlt) { + try { + const parsed = JSON.parse(inputAlt); + argsList = Array.isArray(parsed) ? parsed.map(v => String(v)) : []; + } catch (e) { + console.error(`Error parsing argument input: ${e}. Falling back to empty list`); + } } return this.props.interface.execute_sql(input, argsList); From 02c4e23ad20d3ab23c9e6da0023c4fd18852e2f1 Mon Sep 17 00:00:00 2001 From: Jack Lavigne Date: Thu, 20 Nov 2025 14:34:00 +0100 Subject: [PATCH 8/8] fix: bring back optional params --- example/gauge/Components/Pages/Test/Test.tsx | 58 ++++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/example/gauge/Components/Pages/Test/Test.tsx b/example/gauge/Components/Pages/Test/Test.tsx index ca02bf8e..dfd99f53 100644 --- a/example/gauge/Components/Pages/Test/Test.tsx +++ b/example/gauge/Components/Pages/Test/Test.tsx @@ -19,7 +19,7 @@ interface FunctionDescriptor { index: number; arguments: string[]; name: string; - functionCallback: (input: string, inputAlt: string) => Promise; + functionCallback: (input?: string, inputAlt?: string) => Promise; } interface InputState { @@ -39,7 +39,7 @@ export class TestPage extends DisplayComponent { index: 0, arguments: ["url: string"], name: "DownloadNavigationData", - functionCallback: input => this.props.interface.download_navigation_data(input), + functionCallback: input => this.props.interface.download_navigation_data(input || ""), }, { index: 1, @@ -51,153 +51,153 @@ export class TestPage extends DisplayComponent { index: 2, arguments: ["ident: string"], name: "GetAirport", - functionCallback: input => this.props.interface.get_airport(input), + functionCallback: input => this.props.interface.get_airport(input || ""), }, { index: 3, arguments: ["ident: string"], name: "GetWaypoints", - functionCallback: input => this.props.interface.get_waypoints(input), + functionCallback: input => this.props.interface.get_waypoints(input || ""), }, { index: 4, arguments: ["ident: string"], name: "GetVhfNavaids", - functionCallback: input => this.props.interface.get_vhf_navaids(input), + functionCallback: input => this.props.interface.get_vhf_navaids(input || ""), }, { index: 5, arguments: ["ident: string"], name: "GetNdbNavaids", - functionCallback: input => this.props.interface.get_ndb_navaids(input), + functionCallback: input => this.props.interface.get_ndb_navaids(input || ""), }, { index: 6, arguments: ["ident: string"], name: "GetAirways", - functionCallback: input => this.props.interface.get_airways(input), + functionCallback: input => this.props.interface.get_airways(input || ""), }, { index: 7, arguments: ["fixIdent: string", "fixIcao: string"], name: "GetAirwaysAtFix", - functionCallback: (input, inputAlt) => this.props.interface.get_airways_at_fix(input, inputAlt), + functionCallback: (input, inputAlt) => this.props.interface.get_airways_at_fix(input || "", input || ""), }, { index: 8, arguments: ["center: (lat, long)", "range: nm"], name: "GetAirportsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_airports_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_airports_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 9, arguments: ["center: (lat, long)", "range: nm"], name: "GetWaypointsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_waypoints_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_waypoints_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 10, arguments: ["center: (lat, long)", "range: nm"], name: "GetVhfNavaidsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_vhf_navaids_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_vhf_navaids_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 11, arguments: ["center: (lat, long)", "range: nm"], name: "GetNdbNavaidsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_ndb_navaids_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_ndb_navaids_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 12, arguments: ["center: (lat, long)", "range: nm"], name: "GetAirwaysInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_airways_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_airways_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 13, arguments: ["center: (lat, long)", "range: nm"], name: "GetControlledAirspacesInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_controlled_airspaces_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_controlled_airspaces_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 14, arguments: ["center: (lat, long)", "range: nm"], name: "GetRestrictiveAirspacesInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_restrictive_airspaces_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_restrictive_airspaces_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 15, arguments: ["center: (lat, long)", "range: nm"], name: "GetCommunicationsInRange", functionCallback: (input, inputAlt) => - this.props.interface.get_communications_in_range(this.strToCoords(input), Number(inputAlt || 0)), + this.props.interface.get_communications_in_range(this.strToCoords(input || ""), Number(inputAlt || 0)), }, { index: 16, arguments: ["airportIdent: string"], name: "GetRunwaysAtAirport", - functionCallback: input => this.props.interface.get_runways_at_airport(input), + functionCallback: input => this.props.interface.get_runways_at_airport(input || ""), }, { index: 17, arguments: ["airportIdent: string"], name: "GetDeparturesAtAirport", - functionCallback: input => this.props.interface.get_departures_at_airport(input), + functionCallback: input => this.props.interface.get_departures_at_airport(input || ""), }, { index: 18, arguments: ["airportIdent: string"], name: "GetArrivalsAtAirport", - functionCallback: input => this.props.interface.get_arrivals_at_airport(input), + functionCallback: input => this.props.interface.get_arrivals_at_airport(input || ""), }, { index: 19, arguments: ["airportIdent: string"], name: "GetApproachesAtAirport", - functionCallback: input => this.props.interface.get_approaches_at_airport(input), + functionCallback: input => this.props.interface.get_approaches_at_airport(input || ""), }, { index: 20, arguments: ["airportIdent: string"], name: "GetWaypointsAtAirport", - functionCallback: input => this.props.interface.get_waypoints_at_airport(input), + functionCallback: input => this.props.interface.get_waypoints_at_airport(input || ""), }, { index: 21, arguments: ["airportIdent: string"], name: "GetNdbNavaidsAtAirport", - functionCallback: input => this.props.interface.get_ndb_navaids_at_airport(input), + functionCallback: input => this.props.interface.get_ndb_navaids_at_airport(input || ""), }, { index: 22, arguments: ["airportIdent: string"], name: "GetGatesAtAirport", - functionCallback: input => this.props.interface.get_gates_at_airport(input), + functionCallback: input => this.props.interface.get_gates_at_airport(input || ""), }, { index: 23, arguments: ["airportIdent: string"], name: "GetCommunicationsAtAirport", - functionCallback: input => this.props.interface.get_communications_at_airport(input), + functionCallback: input => this.props.interface.get_communications_at_airport(input || ""), }, { index: 24, arguments: ["airportIdent: string"], name: "GetGlsNavaidsAtAirport", - functionCallback: input => this.props.interface.get_gls_navaids_at_airport(input), + functionCallback: input => this.props.interface.get_gls_navaids_at_airport(input || ""), }, { index: 25, arguments: ["airportIdent: string"], name: "GetPathPointsAtAirport", - functionCallback: input => this.props.interface.get_path_points_at_airport(input), + functionCallback: input => this.props.interface.get_path_points_at_airport(input || ""), }, { index: 26, @@ -215,7 +215,7 @@ export class TestPage extends DisplayComponent { } } - return this.props.interface.execute_sql(input, argsList); + return this.props.interface.execute_sql(input || "", argsList); }, }, { @@ -262,8 +262,8 @@ export class TestPage extends DisplayComponent { private handleFunction = () => { const functionObj = this.selectedFunctionObj.get(); - const input1 = this.input1.get(); - const input2 = this.input2.get(); + const input1 = this.input1.get() || undefined; + const input2 = this.input2.get() || undefined; functionObj .functionCallback(input1, input2)