Don't crash when creating a dive site ID for a nameless site

This can happen when parsing the GPS data from our web service.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-09-27 13:16:40 -04:00
parent fe9958380e
commit cbf29653d7

View file

@ -177,6 +177,8 @@ void delete_dive_site(uint32_t id)
uint32_t create_divesite_uuid(const char *name, timestamp_t divetime)
{
if (name == NULL)
name ="";
unsigned char hash[20];
SHA_CTX ctx;
SHA1_Init(&ctx);