From 4c1d5a4b6d009ce075897d499d3517219bd745a4 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Mon, 29 Apr 2024 02:40:39 -0400 Subject: [PATCH] fix: fix error handling for outdated node versions --- run-selfhosted.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run-selfhosted.js b/run-selfhosted.js index 5915d648da..a9104bbfca 100644 --- a/run-selfhosted.js +++ b/run-selfhosted.js @@ -93,6 +93,16 @@ const early_init_errors = [ } ]; +// null coalescing operator +const nco = (...args) => { + for ( const arg of args ) { + if ( arg !== undefined && arg !== null ) { + return arg; + } + } + return undefined; +} + const _print_error_help = (error_help) => { const lines = []; lines.push(nco(error_help.title, error_help.text));