From f9f63f45ea969020b2936b93051348f54a3b6885 Mon Sep 17 00:00:00 2001
From: Guilherme Arthur Geronimo <guilherme.geronimo@ufsc.br>
Date: Wed, 19 Jun 2024 01:57:08 -0300
Subject: [PATCH] Fix #29

---
 bin/smartdata/Backend.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/smartdata/Backend.php b/bin/smartdata/Backend.php
index 346ea49..b69a98d 100644
--- a/bin/smartdata/Backend.php
+++ b/bin/smartdata/Backend.php
@@ -1766,7 +1766,7 @@ class Backend_V1_1 extends Backend_Common
 
         $parameters = array(':version'   => $tracker->version,
                             ':unit'      => $tracker->unit,
-                            ':signature' => $tracker->signature,
+                            ':signature' => $tracker->signature ?? 0,
                             ':t0'        => $tracker->t0,
                             ':t1'        => $tracker->t1,
                             ':dev'       => $tracker->dev,
@@ -1776,7 +1776,7 @@ class Backend_V1_1 extends Backend_Common
                             ':type'      => $tracker->type ?? 'OLD');
 
         try {
-            if (!property_exists($tracker,"signature") || $tracker->signature == 0) {
+            if (!property_exists($tracker,"signature") || $tracker->signature === 0) {
                 throw new Exception\InternalException('Signature must be provided in Mobile SmartData.');
             }
             $conn = self::_mysqlConnect(Config::config()::MYSQL_SEVERNAME, Config::config()::MYSQL_PORT, Config::config()::MYSQL_DBNAME, Config::config()::MYSQL_USERNAME, Config::config()::MYSQL_PASSWORD);
-- 
GitLab