Apply suggested fix to prevent NPE if generated keys supported. http://issues.apache.org/bugzilla/show_bug.cgi?id=42870