Fixed potential NPE in toString, there's no guarantee that getValue() is always not null.

(transplanted from 225e3d761e2706d6c95c0cd4a1e269cea528392e)
This commit is contained in:
Heng Sin Low 2011-08-17 01:17:00 +08:00
parent 70f93229ad
commit 36f5c84ded
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/******************************************************************************
* Product: Posterita Ajax UI *
* Product: Posterita Ajax UI *
* Copyright (C) 2007 Posterita Ltd. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
@ -62,7 +62,7 @@ public class ListItem extends org.zkoss.zul.Listitem
@Override
public String toString() {
return getValue().toString();
return getValue() != null ? getValue().toString() : "";
}
}