summaryrefslogtreecommitdiff
path: root/java/demo/Freeze/library/Parser.java
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2003-08-22 06:26:36 +0000
committerMichi Henning <michi@zeroc.com>2003-08-22 06:26:36 +0000
commit1b89ba8994566dd10124e03bc0eb0ff4957b39b0 (patch)
tree7df011eafa55fa209af509e1c7c8fe743f4d38bc /java/demo/Freeze/library/Parser.java
parentfile Make.rules.CYGWIN_NT-5.1 was initially added on branch R1_1_branch. (diff)
downloadice-1b89ba8994566dd10124e03bc0eb0ff4957b39b0.tar.bz2
ice-1b89ba8994566dd10124e03bc0eb0ff4957b39b0.tar.xz
ice-1b89ba8994566dd10124e03bc0eb0ff4957b39b0.zip
Fixed bug in library Freeze demo: a next after a failed search caused a
NullPointerException.
Diffstat (limited to 'java/demo/Freeze/library/Parser.java')
-rw-r--r--java/demo/Freeze/library/Parser.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/demo/Freeze/library/Parser.java b/java/demo/Freeze/library/Parser.java
index 1db42caea07..f5b073fa387 100644
--- a/java/demo/Freeze/library/Parser.java
+++ b/java/demo/Freeze/library/Parser.java
@@ -135,7 +135,7 @@ class Parser
void
nextFoundBook()
{
- if(_current != _foundBooks.length)
+ if(_foundBooks != null && _current != _foundBooks.length)
{
++_current;
}
@@ -147,7 +147,7 @@ class Parser
{
try
{
- if(_current != _foundBooks.length)
+ if(_foundBooks != null && _current != _foundBooks.length)
{
BookDescription desc = _foundBooks[_current].getBookDescription();
String renter = null;
@@ -194,7 +194,7 @@ class Parser
try
{
- if(_current != _foundBooks.length)
+ if(_foundBooks != null && _current != _foundBooks.length)
{
_foundBooks[_current].rentBook((String)args.get(0));
System.out.println("the book is now rented by `" + (String)args.get(0) + "'");
@@ -223,7 +223,7 @@ class Parser
{
try
{
- if(_current != _foundBooks.length)
+ if(_foundBooks != null && _current != _foundBooks.length)
{
_foundBooks[_current].returnBook();
System.out.println( "the book has been returned.");
@@ -252,7 +252,7 @@ class Parser
{
try
{
- if(_current != _foundBooks.length)
+ if(_foundBooks != null && _current != _foundBooks.length)
{
_foundBooks[_current].destroy();
System.out.println("removed current book" );