diff options
author | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-01 20:45:15 +0000 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-11-01 20:45:15 +0000 |
commit | 86053f250cf0f21f5fa6d56a7a0cb7c54be2ac04 (patch) | |
tree | a20a6d0a1e714526620a3f69201352a2657a0616 | |
parent | 5de942d31d0545ba92db7d4e126a0368feb4dd44 (diff) |
Handle no results by returning 1
-rw-r--r-- | blasearch.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/blasearch.java b/blasearch.java index 138b995..3ddeb5d 100644 --- a/blasearch.java +++ b/blasearch.java @@ -83,7 +83,7 @@ public class blasearch { } // Print results - if(results != null){ + if(results.size() > 0){ for(int i=0; i<2; i++){ if (i != 0) { System.out.print(" | "); @@ -91,7 +91,10 @@ public class blasearch { int count = i + 1; System.out.print("Result " + count + ": " + results.get(i)); } - } + } else { + System.out.print("Error: no results.\n"); + System.exit(1); + } System.out.print("\n"); } |