[cooja] VarMemory: Actually throw UnknownVariableException

This commit is contained in:
Enrico Joerns 2014-08-07 13:01:50 +02:00
parent 0f2837320c
commit b9ac2953b7

View File

@ -99,7 +99,11 @@ public class VarMemory extends Memory {
* @return Variable address * @return Variable address
*/ */
public Symbol getVariable(String varName) throws UnknownVariableException { public Symbol getVariable(String varName) throws UnknownVariableException {
return memIntf.getSymbolMap().get(varName); Symbol sym = memIntf.getSymbolMap().get(varName);
if (sym == null) {
throw new UnknownVariableException(varName);
}
return sym;
} }
/** /**