fix(Port Numbers): unknown port throws

Fix #209
This commit is contained in:
ShareVB committed 2025-11-23 21:25:02 +01:00
1 parent 23581a34b0
commit 3763f9e076
1 file changed
+1 -1
+1 -1
View File
@@ -9,7 +9,7 @@ const { t } = useI18n();
const port = useQueryParam({ tool: 'port-numbers', name: 'port', defaultValue: 80 });
const protocol = useQueryParam({ tool: 'port-numbers', name: 'proto', defaultValue: 'tcp' });
const result = computed(() => {
const [type, description] = ports[`${port.value}/${protocol.value}` as (keyof typeof ports)];
const [type, description] = ports[`${port.value}/${protocol.value}` as (keyof typeof ports)] || [];
return { type: type ?? 'unknown', description: description ?? 'Unknown' };
});
</script>