Fix undefined value
authorLuciano Montanaro <mikelima@cirulla.net>
Sun, 8 Jan 2012 14:50:23 +0000 (15:50 +0100)
committerLuciano Montanaro <mikelima@cirulla.net>
Sun, 8 Jan 2012 14:50:23 +0000 (15:50 +0100)
application/resources/harmattan/qml/PageHeader.qml

index 1700774..e74ee12 100644 (file)
@@ -62,7 +62,8 @@ Rectangle {
     }
     onSelectedIndexChanged: {
         console.log("Selection changed to: " + selectedIndex)
-        if (options === undefined || options.count === 0) {
+        if (options === undefined || options.count === 0 ||
+                options.get(selectedIndex) === undefined) {
             header.text = " "
         } else {
             header.text = options.get(selectedIndex).name