Can you clarify where in the code this is possible?  I can't find any evidence of a PatternGenerator returning None in imagen/*.py, but must have missed one.  If it can indeed return None, we at least need to mention that possibility explicitly in the ImaGen documentation, and should strongly consider making sure it never happens, so that consumers don't have to include checks like this.  Can you provide an actual test case demonstrating the problem?