← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/ubuntu-weather-app/reboot-fix-startup-console-errors-0 into lp:ubuntu-weather-app/reboot

 

Andrew Hayzen has proposed merging lp:~ahayzen/ubuntu-weather-app/reboot-fix-startup-console-errors-0 into lp:ubuntu-weather-app/reboot.

Commit message:
* Fix for console error on startup if there are no locations

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-weather-app/reboot-fix-startup-console-errors-0/+merge/266046

* Fix for console error on startup if there are no locations

STEPS TO REPRODUCE ISSUE:
1) Ensure that the application has no stored locations and auto detect location is off
2) Restart the application
3) Notice in the console the following
file:///home/andy/Workspace/ubuntu/ubuntu-weather-app-reboot/app/ui/HomePage.qml:105: TypeError: Cannot read property of null

TESTING:
At step 3 no console warning should no appear.
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~ahayzen/ubuntu-weather-app/reboot-fix-startup-console-errors-0 into lp:ubuntu-weather-app/reboot.
=== modified file 'app/ui/HomePage.qml'
--- app/ui/HomePage.qml	2015-07-25 21:49:25 +0000
+++ app/ui/HomePage.qml	2015-07-27 21:55:48 +0000
@@ -102,7 +102,7 @@
         height: parent.height
 
         // FIXME: not sure where the 3GU comes from, PullToRefresh or something in HomePage?
-        contentHeight: locationPages.currentItem.childrenRect.height + units.gu(3)
+        contentHeight: (locationPages.currentItem ? locationPages.currentItem.childrenRect.height : 0) + units.gu(3)
         contentWidth: parent.width
 
         Behavior on contentHeight {

=== modified file 'debian/changelog'
--- debian/changelog	2015-07-26 15:24:27 +0000
+++ debian/changelog	2015-07-27 21:55:48 +0000
@@ -12,6 +12,7 @@
   * Add mocked locations for autopilot and add a test using the data
   * Add setting to disable auto detecting location
   * When running under autopilot do not auto detect location
+  * Fix for console error on startup if there are no locations
 
  -- Victor Thompson <victor.thompson@xxxxxxxxx>  Mon, 01 Jun 2015 20:11:23 -0500