Yadoms / yadoms

Yadoms is open source, simple, powerfull, flexible and multiplatforms domotic solution.
https://www.yadoms.com
Other
63 stars 17 forks source link

[REST API] Yadoms crash with a runtime error when keywordId is not found in database #717

Closed oben01 closed 3 years ago

oben01 commented 3 years ago

I did a POST request to /device/keywordslastvalue with a Request Body as :

{
  "keywordIds": [
    1,
    2,
    36
  ]
}

Yadoms crash with a runtime error when keywordId is not found in database (in my case 36) Is that possible to send an empty fields insteed of crashing ? 🗡️

sgallou commented 3 years ago

Can not reproduce, from the feature/Swagger branch (commit f97278e0d5aed2331a2d215305245e12fa3857e8), only existing keywords are returned, and no crash happens. What is your Yadoms version/branch ?

image

oben01 commented 3 years ago

I get more information. Yadoms crash when lastAcquisitionValue is equal to NULL in database LastAcquisition Yadoms crash at extractValueAsString in SQLiteResultHandler.cpp

sgallou commented 3 years ago

Closed by 30901045a436f3a88a7d3af394500f8def74adfc