diff --git a/apps/tracer/src/MemoryView.tsx b/apps/tracer/src/MemoryView.tsx index bd444d2..5ca8664 100644 --- a/apps/tracer/src/MemoryView.tsx +++ b/apps/tracer/src/MemoryView.tsx @@ -51,7 +51,12 @@ export default function MemoryView({ address, onSelectAddress }: MemoryViewProps }, [address]); const adjustAddress = useCallback((delta: number) => { - const newAddress = BigInt(addressInputRef.current!.value) + BigInt(delta); + let newAddress: bigint; + try { + newAddress = BigInt(addressInputRef.current!.value) + BigInt(delta); + } catch (e) { + return; + } onSelectAddress(newAddress); }, [onSelectAddress]); @@ -71,7 +76,7 @@ export default function MemoryView({ address, onSelectAddress }: MemoryViewProps onKeyDown={e => { if (e.key === "Enter") { e.preventDefault(); - onSelectAddress(BigInt(addressInputRef.current!.value)); + adjustAddress(0); } }} placeholder="Memory address…"