[BUG] Possible Bug Ignition 7.9.14 User Management Component

I upgraded my development gateway to v7.9.14. Everything was working fine while adding a couple of users with the management component. After adding a user an error popped up and the list of users went blank.

java.lang.NullPointerException
	at com.inductiveautomation.factorypmi.application.components.UserManagementPanel$UserTable$7.apply(UserManagementPanel.java:2789)
	at com.inductiveautomation.factorypmi.application.components.UserManagementPanel$UserTable$7.apply(UserManagementPanel.java:2785)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at com.google.common.collect.Iterators.addAll(Iterators.java:361)
	at com.google.common.collect.Lists.newArrayList(Lists.java:160)
	at com.google.common.collect.Collections2$FilteredCollection.toArray(Collections2.java:217)
	at java.base/java.util.ArrayList.addAll(Unknown Source)
	at com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable$CRUDModel.updateItems(AbstractCRUDTable.java:879)
	at com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable$Loader.done(AbstractCRUDTable.java:832)
	at java.desktop/javax.swing.SwingWorker$5.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
	at java.desktop/sun.swing.AccumulativeRunnable.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.Timer.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.Timer$DoPostEvent.run(Unknown Source)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v7.9.14 (b2020042813)
Java: Azul Systems, Inc. 9.0.7.4
'''

Turns out this error is coming from the filterRole extension function. If I disable it, the component works fine. Otherwise, I get a null pointer error. Below is the filtering script that worked perfectly before

userRoles = user.getRoles() 
for role in userRoles:
	if 'operators' in role:
		return 1
	else:
		return 0

Steps to remedy error

  1. Downgrade to 7.9.13 -> no change
  2. Downgrade to 7.9.12 -> no change
  3. Import project backup from 7.9.12 production server to 7.9.12 dev server -> no change
  4. Install production gateway backup into dev server -> null pointer fixed
  5. upgrade dev server to 7.9.14 -> no issues yet, but this is the version that the error originally occurred

Turns out the null pointer is coming from saving a user without a role selected. Once this happens, I have to go to the gateway page and add a role to the user for the component to start working again. I do have a filter role extension function running, however once I added the user role and comment out the filter role script the null pointer error pops up again.