private boolean isClosedProgram(Navigatable navigatable, ProgramLocation location) {
			Program program = location.getProgram();
			if (program.isClosed()) {

				Msg.showError(this, null, "Closed Program", """
						The Navigation History Plugin is using a closed program.
						Program: %s
						Navigatable: %s
						Location: %s @ %s"""
						.formatted(program.getName(), navigatable.getClass().getSimpleName(),
							location.getClass().getSimpleName(), location.getAddress()));
				return true;
			}

			return false;
		}
Find the previous history LocationMemento that contains a different function. If no such
LocationMemento is found, null is returned.

@param navigatable the navigatable being navigated
@param moveTo true means after finding, get current location to it. false to just find
           and do nothing
@return previous LocationMemento, or null if no previous function found
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/NavigationHistoryPlugin.java