Set Intersection with an empty set

I need to get an intersection of two sets (strings representing paths). Sometimes one set is empty, with no data collected and then I’m getting the other set as result. I’m expecting the intersection result rather to be empty. I’m getting this result when I convert empty data to Null. Can I achieve it easier with Set Intersection or a Python script that would do it all?

set_intersection2.gh (10.0 KB)

This Python script seems to work fine (using List Access):

x = set(x)
y = set(y)
a = sorted(x.intersection(y))

set_intersection2b.gh (9.1 KB)