From c5d43e9d7fea6f05bd8e2cbbc54d43864f8fa52f Mon Sep 17 00:00:00 2001 From: renfeiw Date: Wed, 3 Aug 2022 13:11:47 -0400 Subject: [PATCH] Add error handling when spec not found - print useful message to replace null point exception Signed-off-by: renfeiw --- src/org/testKitGen/Arguments.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/org/testKitGen/Arguments.java b/src/org/testKitGen/Arguments.java index 5f46f4bc..5d9dfe56 100644 --- a/src/org/testKitGen/Arguments.java +++ b/src/org/testKitGen/Arguments.java @@ -151,7 +151,13 @@ private String spec2Plat(String spec) { Properties platProp = new Properties(); platProp.load(platReader); plat = platProp.getProperty(spec); + if (plat == null) { + System.err.println("Error: Please update file " + Constants.BUILDPLAT_JSON + "! Add entry for " + spec + "."); + System.exit(1); + } } catch (IOException e) { + e.printStackTrace(); + System.exit(1); } return plat; }