Catch RuntimeException in draw() and switching to a new effect if this happens.