private CodeUnit getCodeUnitForAddress(Address address) {
			CodeUnit codeUnit = null;

			if ((currentProgram != null) && (currentLocation != null)) {
				Listing listing = currentProgram.getListing();
				codeUnit = listing.getCodeUnitAt(address);

				// if the CodeUnit is Data and is not defined, then we need to try to virtually
				// disassemble it
				if (codeUnit instanceof Data) {
					if (!((Data) codeUnit).isDefined()) {
						CodeUnit virtualCodeUnit = virtuallyDisassembleAddress(address);

						if (virtualCodeUnit != null) {
							codeUnit = virtualCodeUnit;
						}
					}
				}
			}

			return codeUnit;
		}
Get the code unit from the program location.

@param address the address from which we want the CodeUnit.
@return null if there is no location.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java