private String[] getComment(Address address) {

		Program program = codeUnit.getProgram();
		Listing listing = program.getListing();

		// prefer listing comments first since there may not be a code unit at this address
		String repeatable = listing.getComment(CommentType.REPEATABLE, address);
		if (repeatable != null) {
			return StringUtilities.toLines(repeatable);
		}

		CodeUnit cu = listing.getCodeUnitAt(address);
		if (cu == null) {
			return null;
		}

		Function f = listing.getFunctionAt(address);
		if (f != null) {
			return f.getRepeatableCommentAsArray();
		}

		return cu.getCommentAsArray(CommentType.REPEATABLE);
	}
Check if this address could be a valid address in the program. 0 id not a valid address.

@param program program to check if address is valid within
@param address address in program to be checked
@return true if this is a valid address
Ghidra/Features/Base/src/main/java/ghidra/app/util/EolComments.java