Benchit icon indicating copy to clipboard operation
Benchit copied to clipboard

NullPointerException on calling analyze() if no record exists

Open inhaledesign opened this issue 9 years ago • 1 comments

If I call Benchit.analyze("test") when no records for "test" have been recorded, I'll get this exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'com.tspoon.benchit.Result com.tspoon.benchit.Benchmark.result()' on a null object reference

I know it's kindof minor and I could catch the exception myself, but it would be preferable if an empty result could be returned and .log() would print out a message indicating there were no records.

inhaledesign avatar Nov 03 '16 03:11 inhaledesign

Makes sense - should be an easy fix. I'll see if I can take care of this soon!

T-Spoon avatar Nov 14 '16 13:11 T-Spoon