Fixed #17541 -- Fixed non-saved/nullable fk querying