DoSomething / aurora

:crescent_moon: The DoSomething.org admin interface.
https://admin.dosomething.org
MIT License
1 stars 2 forks source link

Don't break edit user page if a feature_flag isn't set #224

Closed katiecrane closed 5 years ago

katiecrane commented 5 years ago

The edit user page was breaking if one feature_flags value is set but not the other. Things were fine if the user had no feature_flags or had both feature_flags (here being badges and refer-friends).

@mendelB found this tidbit to explain that behavior:

PHP won't attempt the comparison if the array is null.

In the second circumstance, a comparison does occur because the array is set. PHP does not check to see if it is empty.

and he also suggested using data_get to make sure we aren't trying to access null elements. I've made that update here!