From 4ef249884af5125be48b42f8fc46cd74ebd62790 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Sun, 23 Jan 2011 21:17:21 +0000 Subject: [PATCH] Return 0 in method cur when the elements list is empty --- .../src/main/java/com/google/gwt/query/client/GQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index 57616c0d..6cc8df8c 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -1016,7 +1016,7 @@ public class GQuery implements Lazy { * - When true returns the real computed value. */ public double cur(String prop, boolean force) { - return styleImpl.cur(get(0), prop, force); + return size() == 0 ? 0 : styleImpl.cur(get(0), prop, force); } /** -- 2.39.5