Skip to content

Commit 8371ed5

Browse files
committed
Avoid request with empty station ID
1 parent c0ed995 commit 8371ed5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

DBAPI.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ DBdeparr* DBAPI::getStationBoard(
118118
uint8_t maxDuration,
119119
uint16_t productFilter
120120
) {
121+
// sanity check, if no station is supplied, a request would crash ArduinJSON later.
122+
if (stationId == NULL || !strlen(stationId)) {
123+
return NULL;
124+
}
121125
while (deparr != NULL) {
122126
DBdeparr* next = deparr->next;
123127
free(deparr);

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "DBAPI",
3-
"version": "2.1.4",
3+
"version": "2.1.6",
44
"description": "Hacon/Hafas/DB API for ESP8266 / ESP32 (WiFiClientSecure)",
55
"keywords": "train, deutsche bahn, travel",
66
"repository":

0 commit comments

Comments
 (0)