Add test case for ctx being null which causes errors

Which happens when recreating filters without a ctx object from server
(and can happen if null is passed in)
Fix error happening when ctx is null