From e7622f08814c6c7a1166addf9bc23c5780bd74b0 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 4 Feb 2006 05:05:03 +0000 Subject: Fixed a bug about performing databind with an empty dataset. --- framework/Web/UI/WebControls/TListControl.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'framework/Web/UI/WebControls/TListControl.php') diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 169cc72c..00381890 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -151,6 +151,8 @@ abstract class TListControl extends TDataBoundControl $items=$this->getItems(); if(!$this->getAppendDataBoundItems()) $items->clear(); + if(!($data instanceof Traversable)) + return; $textField=$this->getDataTextField(); if($textField==='') $textField=0; -- cgit v1.2.3