BackgroundfindByName can return null, getByName throws an exception if an object with the required name is not found.
We pass the found configuration result to the setExtendsFrom function, this function cannot handle nullable objects. As a result, NPE will be thrown inside setExtendsFrom without details about the not found configuration.
Changes
Replace findByName to getByName
Test plan
Green pipelines. Not production logic was changed.
Background
findByName
can return null,getByName
throws an exception if an object with the required name is not found. We pass the found configuration result to thesetExtendsFrom
function, this function cannot handle nullable objects. As a result, NPE will be thrown insidesetExtendsFrom
without details about the not found configuration.Changes Replace
findByName
togetByName
Test plan Green pipelines. Not production logic was changed.
References https://github.com/google/protobuf-gradle-plugin/issues/623