util: Avoid division by invalid value

Check for max > min before dividing by difference

Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: Ic2a983bb6f7c04f1deafcab228b76ff60012f011
diff --git a/dbus/util.cpp b/dbus/util.cpp
index 6d5d2c0..33e0985 100644
--- a/dbus/util.cpp
+++ b/dbus/util.cpp
@@ -187,7 +187,7 @@
 
 void scaleSensorReading(const double min, const double max, double& value)
 {
-    if (max <= 0)
+    if (max <= 0 || max <= min)
     {
         return;
     }