aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/GridLayout.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/awt/GridLayout.java')
-rw-r--r--libjava/java/awt/GridLayout.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/libjava/java/awt/GridLayout.java b/libjava/java/awt/GridLayout.java
index 3471865..32f1cf8 100644
--- a/libjava/java/awt/GridLayout.java
+++ b/libjava/java/awt/GridLayout.java
@@ -152,6 +152,12 @@ public class GridLayout implements LayoutManager, Serializable
public void layoutContainer (Container parent)
{
int num = parent.ncomponents;
+
+ // There's no point, and handling this would mean adding special
+ // cases.
+ if (num == 0)
+ return;
+
// This is more efficient than calling getComponents().
Component[] comps = parent.component;