fix: Add another address check for creating functions
This commit is contained in:
parent
58f22316bd
commit
8aded2e6c3
@ -509,6 +509,12 @@ public class FunctionEndpoints extends AbstractEndpoint {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if address is in a valid memory block
|
||||||
|
if (program.getMemory().getBlock(address) == null) {
|
||||||
|
sendErrorResponse(exchange, 400, "Address is not in a defined memory block: " + addressStr, "INVALID_ADDRESS");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if function already exists
|
// Check if function already exists
|
||||||
if (program.getFunctionManager().getFunctionAt(address) != null) {
|
if (program.getFunctionManager().getFunctionAt(address) != null) {
|
||||||
sendErrorResponse(exchange, 409, "Function already exists at address: " + addressStr, "FUNCTION_EXISTS");
|
sendErrorResponse(exchange, 409, "Function already exists at address: " + addressStr, "FUNCTION_EXISTS");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user