From cf9da3125e19b2fbcf850e180deaef46360e4bbe Mon Sep 17 00:00:00 2001 From: Pazzilivo Date: Sun, 27 Oct 2019 23:17:50 +0800 Subject: [PATCH] Fix: config.history may be empty (#16) --- src/containers/Proxies/components/Proxy/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/Proxies/components/Proxy/index.tsx b/src/containers/Proxies/components/Proxy/index.tsx index 8467a5b..a4afb3d 100644 --- a/src/containers/Proxies/components/Proxy/index.tsx +++ b/src/containers/Proxies/components/Proxy/index.tsx @@ -43,7 +43,7 @@ export function Proxy (props: ProxyProps) { } useEffect(() => { - setDelay(config.history.length ? config.history.slice(-1)[0].delay : 0) + setDelay(config.history && config.history.length ? config.history.slice(-1)[0].delay : 0) }, [config]) useLayoutEffect(() => {