diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-09-25 18:22:49 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-14 11:00:25 +0100 |
commit | db45a68715c07e6b8fe35e322ddcbbc6c473cb2b (patch) | |
tree | 43c1be13ddf78810ef8264b0816aad7d1565d92f /signal-composer-binding/signal.cpp | |
parent | fb1d083aa2702b96ff33ab7f3249ef9b1ed5a715 (diff) |
No errors on get if no values has been recorded
Change-Id: Ib1d5da084b3a39fbfc9816070aba008e3486cfae
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.cpp')
-rw-r--r-- | signal-composer-binding/signal.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp index a74889d..faae4a3 100644 --- a/signal-composer-binding/signal.cpp +++ b/signal-composer-binding/signal.cpp @@ -288,8 +288,9 @@ double Signal::maximum(int seconds) const /// @brief Return last value recorded /// /// @return Last value -struct SignalValue Signal::last() const +struct signalValue Signal::last() const { + if(history_.empty()) {return signalValue({0,0,0,0,0,""});} return history_.rbegin()->second; } |