From faefee2cb2b64e10ff4f874f6da6e032d84f0ff2 Mon Sep 17 00:00:00 2001 From: TomlongTK Date: Wed, 8 May 2024 11:51:00 +0800 Subject: [PATCH] Optimize convertToNumber method (#14159) --- .../src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java index 53cd36894de..228392fe021 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java @@ -317,7 +317,7 @@ public static Long convertToNumber(Object obj) { timeout = Long.parseLong((String) obj); } else if (obj instanceof Number) { timeout = ((Number) obj).longValue(); - } else { + } else if (obj != null) { timeout = Long.parseLong(obj.toString()); } } catch (Exception e) {