komoku / aetheria

Aetheria Game Engine - Migrated from code.google.com/p/aetheria
Other
8 stars 0 forks source link

Problema en algunas situaciones para devolver nulo en BeanShell #267

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Estas líneas:

Entity messageHandler = entity("Mensajes de combate");
String theMessage = messageHandler.getMessage( messageName , arguments );
return theMessage;

Funcionan bien. Sin embargo, si lo ponemos así: 

Entity messageHandler = entity("Mensajes de combate");
return messageHandler.getMessage( messageName , arguments );

(al menos) cuando getMessage (implementado en beanshell directamente en la 
entidad) devuelve null, obtenemos este error interno del intérprete de 
beanshell:

bsh.InterpreterError: null fromValue
    at bsh.Types.castObject(Unknown Source)
    at bsh.BshMethod.invokeImpl(Unknown Source)
    at bsh.BshMethod.invoke(Unknown Source)
    at bsh.BshMethod.invoke(Unknown Source)
    at bsh.Name.invokeLocalMethod(Unknown Source)
    at bsh.Name.invokeMethod(Unknown Source)
    at bsh.BSHMethodInvocation.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at eu.irreality.age.ObjectCode.run(ObjectCode.java:402)
    at eu.irreality.age.World.execCode(World.java:2151)
    at eu.irreality.age.messages.Messages.getMessage(Messages.java:111)
    at eu.irreality.age.messages.Messages.getMessage(Messages.java:187)
    at eu.irreality.age.Room.getPresentMobilesSingularString(Room.java:931)
    at eu.irreality.age.Room.getDescription(Room.java:898)
    at eu.irreality.age.Player.show_room(Player.java:3443)
    at eu.irreality.age.Player.characterChangeState(Player.java:2180)
    at eu.irreality.age.Player.changeState(Player.java:2085)
    at eu.irreality.age.Entity.update(Entity.java:311)
    at eu.irreality.age.Player.update(Player.java:277)
    at eu.irreality.age.Entity.update(Entity.java:95)
    at eu.irreality.age.World.update(World.java:2713)
    at eu.irreality.age.GameEngineThread.run(GameEngineThread.java:308)

El porqué es un misterio.

Original issue reported on code.google.com by komoku on 12 Aug 2012 at 5:28

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r549.

Original comment by komoku on 21 Aug 2012 at 4:48