Project

General

Profile

Bug #587

forecast.io plugin: defaults button causes (somethimes) "not an object" error.

Added by johanvandyck almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
DomotiGa3
Target version:
Start date:
10/14/2015
Due date:
% Done:

100%

Estimated time:
1.00 h
Resolution:
Fixed

Description

Hi

While developping my new module buienrader, I stumbled against a bug in the forecast.io plugin. Both in 1.021 and 1.022 versions.

Reproduce:
- open forecast.io settings
- enable module if not so
- do a search which gives at least one result like "kk"
- push "defaults".--> "This application has raised an unexpected error and must abord". [12] Not an object. FSettingsForecastIo.cmbcities_Click 130.
(crash of DomotiGa).

Workaround:
I didn't go to the bottum of this. Sorry alexie I'm not an expert yet, but if you adapt the code of the btnDefaults_click() in FSettingsForecastIo.cmbcities_Click around line 130, it works fine: (add 4 initialisation lines)

Public Sub btnDefaults_Click()
$cCity.Clear
cmbCities.Clear
vbLatitude.Value = "" 
vbLongitude.Value = "" 
LoadSettings(0)
btnSave.Enable = True
End

Regards

Johan.

History

#1 Updated by johanvandyck almost 4 years ago

Hi

I found the problem: When loading the defaults, only part of the cmbCities collection is loaded. When pushing the defaults button, lat/lon info is not available -> error raised.

Solution:
- change FSettingsForecastIo.cmbcities_Click like described above to clear cCities.
- change the "private Sub LoadSettings (iRow As Integer) as boolean" subroutine.
add the line

$cCity[cmbcities.text] = ["latitude": vbLatitude.Value, "Longitude": vbLongitude.Value]

after the vbLongitude.Value = rResult!longitude assignation in the subroutine. (around line 5:204)

It will look like:

Private Sub LoadSettings(iRow As Integer) As Boolean

  Dim rResult As Result

  rResult = Plugin.GetSettingsTable("settings_forecastio", iRow)

  If rResult.Count Then
    chkEnabled.Value = rResult!enabled
    cmbCities.Add(rResult!city)
    cmbCities.Text = rResult!city
    vbLatitude.Value = rResult!latitude
    vbLongitude.Value = rResult!longitude
    $cCity[cmbCities.Text] = ["latitude": vbLatitude.Value, "longitude": vbLongitude.Value]
    chkDebug.Value = rResult!debug
    txtApiKey.Text = rResult!apikey
    txtRefresh.Text = rResult!polltime
    Return True
  Else
    Return False
  Endif

End

Regards

Johan.

#2 Updated by Alexie almost 4 years ago

  • Status changed from New to Resolved
  • Target version changed from 1.0.021 to 1.0.022
  • % Done changed from 0 to 100
  • Resolution set to Fixed

Thanks, and fixed in the BETA :-)

#3 Updated by wwolkers almost 4 years ago

  • Status changed from Resolved to Closed

Fixed in 1.0.022

Also available in: Atom PDF