Skip to content
Snippets Groups Projects
Commit c23b9b58 authored by mcmlxxix's avatar mcmlxxix
Browse files

don't crash if there is no openweathermap section in modopts.ini

parent 341b5f83
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,11 @@ load('modopts.js');
function OpenWeatherMap() {
this.settings = get_mod_options('openweathermap');
if (!this.settings.rate_window) this.settings.rate_window = 60; // Seconds
if(this.settings == undefined) {
this.settings = {};
}
if (!this.settings.rate_window) this.settings.rate_window = 60; // Seconds
if (!this.settings.rate_limit) this.settings.rate_limit = 60; // Requests per window
if (!this.settings.data_refresh) this.settings.data_refresh = 7200; // Seconds
this.rate_file = new File(system.temp_dir + 'openweathermap_rate.json');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment