protected Function getFunctionForLocation() {
		if (location instanceof FunctionLocation functionLocation) {
			Address functionAddress = functionLocation.getFunctionAddress();
			return program.getFunctionManager().getFunctionAt(functionAddress);
		}
		Address address = getAddress();
		if (address != null) {
			return program.getFunctionManager().getFunctionContaining(address);
		}
		return null;
	}
Returns the code unit containing the action's program location or null
@return the code unit containing the action's program location or null
Ghidra/Features/Base/src/main/java/ghidra/app/context/ProgramLocationActionContext.java