Update HomeAssistantApp.mc

Guard against dereferencing null. Belt & braces, as this has not been an issue.
This commit is contained in:
Philip Abbey
2024-07-26 17:16:07 +01:00
parent 98c9c42366
commit 9eed5affdc

View File

@ -262,11 +262,13 @@ class HomeAssistantApp extends Application.AppBase {
}
function startUpdates() {
mItemsToUpdate = mHaMenu.getItemsToUpdate();
// Start the continuous update process that continues for as long as the application is running.
// The chain of functions from 'updateNextMenuItem()' calls 'updateNextMenuItem()' on completion.
if (mItemsToUpdate.size() > 0) {
updateNextMenuItemInternal();
if (mHaMenu != null) {
mItemsToUpdate = mHaMenu.getItemsToUpdate();
// Start the continuous update process that continues for as long as the application is running.
// The chain of functions from 'updateNextMenuItem()' calls 'updateNextMenuItem()' on completion.
if (mItemsToUpdate.size() > 0) {
updateNextMenuItemInternal();
}
}
}