[Core] Force get_actor(name)'s name to be non-empty string (#12218)

This commit is contained in:
Ian Rodney
2020-11-23 12:38:16 -08:00
committed by GitHub
parent 32d159a2ed
commit 7f1f16d99e
3 changed files with 11 additions and 0 deletions
@@ -216,6 +216,9 @@ public final class RayNativeRuntime extends AbstractRayRuntime {
@SuppressWarnings("unchecked")
@Override
public <T extends BaseActorHandle> Optional<T> getActor(String name, boolean global) {
if (name.isEmpty()) {
return Optional.empty();
}
byte[] actorIdBytes = nativeGetActorIdOfNamedActor(name, global);
ActorId actorId = ActorId.fromBytes(actorIdBytes);
if (actorId.isNil()) {