From 10058417721b9e30c5326a9860a062f4965c9a9e Mon Sep 17 00:00:00 2001 From: Mike Klimek Date: Wed, 7 Dec 2016 23:22:05 +0100 Subject: [PATCH] Don't print destination if it is null --- src/arden/runtime/StdIOExecutionContext.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/arden/runtime/StdIOExecutionContext.java b/src/arden/runtime/StdIOExecutionContext.java index 6792c9f..813992e 100644 --- a/src/arden/runtime/StdIOExecutionContext.java +++ b/src/arden/runtime/StdIOExecutionContext.java @@ -19,7 +19,8 @@ public StdIOExecutionContext(CommandLineOptions options) { @Override public DatabaseQuery createQuery(MedicalLogicModule mlm, String mapping) { - System.out.println("Query mapping: \"" + mapping + "\". Enter result as " + "Arden Syntax constant (Strings in quotes)"); + System.out.println( + "Query mapping: \"" + mapping + "\". Enter result as " + "Arden Syntax constant (Strings in quotes)"); System.out.print(PROMPT_SIGN); ArdenValue[] val = null; @@ -99,10 +100,13 @@ public void write(ArdenValue message, ArdenValue destination, double urgency) { System.out.println(message); } } else { - // prepend destination to printed string - System.out.print("Destination: "); - System.out.print(destination); - System.out.print(" Message: "); + if (destination != null) { + // prepend destination to printed string + System.out.print("Destination: "); + System.out.print(destination); + System.out.print(" "); + } + System.out.print("Message: "); if (message instanceof ArdenString) { System.out.println(ArdenString.getStringFromValue(message)); } else {