NPE with Java SDK and Atomic Counters

In my CBL custom event handler I have the following code:









// counter working with long values

			String counterName = "CouponAtomicValue";

			long david = Backendless.Counters.getAndIncrement(counterName);

but I get a Null Pointer Exception when I run the code in CodeRunner (latest downloaded) but it works when deployed.

Hi Simon!
This error appears because the server returns null instead of 0 for a new counter (it was fixed in a new version of service). You can try with incrementAndGet() method tho avoid Null Pointer Exception.
Atomic Counters API:
http://backendless.com/documentation/utilities/android/ut_atomic_counters_api_android.htm

Regards,
Kate.