TMF: Add some XML basic test cases and fix a bug
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.analysis.xml.core / src / org / eclipse / tracecompass / tmf / analysis / xml / core / model / readwrite / TmfXmlReadWriteStateValue.java
index 4d7994ad495f2fceb2fcbcd2fddb204fb86a44b8..8bb039f52d410ee6170875bd0ffc1ffb5fb1668f 100644 (file)
@@ -207,14 +207,16 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
             switch (fValue.getType()) {
             case LONG: {
                 long incrementLong = fValue.unboxLong();
-                long currentValue = ss.queryOngoingState(quark).unboxLong();
+                ITmfStateValue currentState = ss.queryOngoingState(quark);
+                long currentValue = (currentState.isNull() ? 0 : currentState.unboxLong());
                 ITmfStateValue value = TmfStateValue.newValueLong(incrementLong + currentValue);
                 processValue(quark, timestamp, value);
                 return;
             }
             case INTEGER: {
                 int increment = fValue.unboxInt();
-                int currentValue = ss.queryOngoingState(quark).unboxInt();
+                ITmfStateValue currentState = ss.queryOngoingState(quark);
+                int currentValue = (currentState.isNull() ? 0 : currentState.unboxInt());
                 ITmfStateValue value = TmfStateValue.newValueInt(increment + currentValue);
                 processValue(quark, timestamp, value);
                 break;
This page took 0.023373 seconds and 5 git commands to generate.