From 86053f250cf0f21f5fa6d56a7a0cb7c54be2ac04 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Mon, 1 Nov 2010 20:45:15 +0000 Subject: Handle no results by returning 1 --- blasearch.java | 7 +++++-- 1 file 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"); } -- cgit v1.2.3