From ab179e4e8389b6ee6adf1c664431905e82e5bfe3 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 23 Dec 2019 22:51:59 +0000 Subject: [PATCH] Bugfix: Check to make sure that a user's watchlist exists before checking to see if it's an array --- module_index.json | 4 ++-- modules/feature-watchlist.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module_index.json b/module_index.json index 2820b94..2f1205b 100755 --- a/module_index.json +++ b/module_index.json @@ -172,10 +172,10 @@ { "id": "feature-user-preferences", "name": "User Preferences", - "version": "0.3.3", + "version": "0.3.4", "author": "Starbeamrainbowlabs", "description": "Adds a user preferences page, letting people do things like change their email address and password.", - "lastupdate": 1577140256, + "lastupdate": 1577140301, "optional": false, "extra_data": [] }, diff --git a/modules/feature-watchlist.php b/modules/feature-watchlist.php index cddf2ba..517867e 100644 --- a/modules/feature-watchlist.php +++ b/modules/feature-watchlist.php @@ -154,7 +154,7 @@ register_module([ // If the watchlist doesn't exist, create it // Note that saving this isn't essential - so we don't bother unless we perform some other action too. - if(!is_array($env->user_data->watchlist)) + if(!isset($env->user_data->watchlist) || !is_array($env->user_data->watchlist)) $env->user_data->watchlist = []; switch($do) {