File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/java/com/nordstrom/automation/junit Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ static <T> AtomicTest<T> newAtomicTest(Object runner, T identity) {
114114 */
115115 @ SuppressWarnings ("unchecked" )
116116 static <T > AtomicTest <T > getAtomicTestOf (Object testKey ) {
117- return (AtomicTest <T >) RUNNER_TO_ATOMICTEST .get (testKey );
117+ return (testKey == null ) ? null : ( AtomicTest <T >) RUNNER_TO_ATOMICTEST .get (testKey );
118118 }
119119
120120 /**
@@ -129,7 +129,9 @@ private static <T> AtomicTest<T> setTestFailure(Failure failure) {
129129 if (atomicTest == null ) {
130130 atomicTest = getAtomicTestOf (failure .getDescription ());
131131 }
132- atomicTest .setThrowable (failure .getException ());
132+ if (atomicTest != null ) {
133+ atomicTest .setThrowable (failure .getException ());
134+ }
133135 return atomicTest ;
134136 }
135137
@@ -141,6 +143,6 @@ private static <T> AtomicTest<T> setTestFailure(Failure failure) {
141143 * @return {@code true} if the run watcher in question supports the specified atomic test; otherwise {@code false}
142144 */
143145 private static boolean isSupported (RunWatcher <?> watcher , AtomicTest <?> atomicTest ) {
144- return watcher .supportedType ().isInstance (atomicTest .getIdentity ());
146+ return ( atomicTest == null ) ? false : watcher .supportedType ().isInstance (atomicTest .getIdentity ());
145147 }
146148}
You can’t perform that action at this time.
0 commit comments