Adding a check to ensure the number isn't "undefined" before
authorBrian Jones <brian.j.jones@intel.com>
Thu, 3 May 2012 21:49:19 +0000 (14:49 -0700)
committerBrian Jones <brian.j.jones@intel.com>
Thu, 3 May 2012 21:49:19 +0000 (14:49 -0700)
displaying it.

qml/CallItemViewLarge.qml

index 01cc891..4d56b97 100644 (file)
@@ -22,27 +22,23 @@ Item
     state : 'disconnected'
 
     onCallChanged: {
-     console.log("*** call changed in large, before if")   
-     if(call && call.msisdn) {
+        console.log("*** call changed in large, before if")
+        if(call && call.msisdn) {
             console.log("*** in calllarge if >> " + call.state );
-           
-           root.state = call.state
-
-          /*  if (call.name) {
-                root.callerLabelText = call.name;
-
-
-            } else {
-            */
-               if (call.numberLen <= 10)
-               {
-                  root.callerLabelText = call.msisdn[0] + call.msisdn[1] + call.msisdn[2] + '-' +
-                                        call.msisdn[3] + call.msisdn[4] + call.msisdn[5] + '-' +
-                                         call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9];
-               }
-               else
-                 root.callerLabelText = call.msisdn;
-           //}
+
+            root.state = call.state
+
+            if (call.msisdn !== undefined && call.msisdn[0]!== undefined)
+            {
+                if (call.msisdn.trim().length <= 10)
+                {
+                    root.callerLabelText = call.msisdn[0] + call.msisdn[1] + call.msisdn[2] + '-' +
+                            call.msisdn[3] + call.msisdn[4] + call.msisdn[5] + '-' +
+                            call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9];
+                }
+                else
+                    root.callerLabelText = call.msisdn;
+            }
         }
     }