Code review comment: Is there a possibility of getting `null` here?

Code under review:
public static Hover getHover(HoverContext context) {
        Optional<Document> srcFile = context.currentDocument();
        Optional<SemanticModel> semanticModel = context.currentSemanticModel();
        if (semanticModel.isEmpty() || srcFile.isEmpty()) {
            return HoverUtil.getHoverObject("");
        }
        
        fillTokenInfoAtCursor(context);

        Position cursorPosition = context.getCursorPosition();
        LinePosition linePosition = LinePosition.from(cursorPosition.getLine(), cursorPosition.getCharacter());
        
        context.checkCancelled();
        Optional<? extends Symbol> symbolAtCursor = semanticModel.get().symbol(srcFile.get(), linePosition);
        
        context.checkCancelled();

        HoverObjectResolver provider = new HoverObjectResolver(context);
        Hover hoverObj = HoverUtil.getHoverObject("");

        
        if (symbolAtCursor.isEmpty()) {
            Range nodeRange = new Range(context.getCursorPosition(), context.getCursorPosition());
            NonTerminalNode nodeAtCursor = CommonUtil.findNode(nodeRange, srcFile.get().syntaxTree());
            if (nodeAtCursor != null) {
                MatchedExpressionNodeResolver expressionResolver = new MatchedExpressionNodeResolver(nodeAtCursor);
                Optional<ExpressionNode> expr = expressionResolver.findExpression(nodeAtCursor);
                if (expr.isPresent()) {
                    hoverObj = provider.getHoverObjectForExpression(expr.get());
                }
            }
        } else {
            hoverObj = provider.getHoverObjectForSymbol(symbolAtCursor.get());
        }
        
        if (hoverObj.getContents().isRight()) {
            MarkupContent markupContent = hoverObj.getContents().getRight();
            String content = markupContent.getValue();

            HoverSymbolResolver symbolResolver =
                    new HoverSymbolResolver(context, semanticModel.get());
            Optional<Symbol> symbol = context.getNodeAtCursor().apply(symbolResolver);
            if (symbol == null || symbol.isEmpty() || !symbolResolver.isSymbolReferable()) {
                return hoverObj;
            }

            Optional<ModuleID> moduleID = symbol.flatMap(Symbol::getModule).map(ModuleSymbol::id);
            Optional<HoverConstructKind> constructKind = symbolResolver.getConstructKind();
            if (moduleID.isEmpty() || symbol.get().getName().isEmpty() || constructKind.isEmpty()) {
                return hoverObj;
            }
            String url = APIDocReference.from(moduleID.get().orgName(),
                    moduleID.get().moduleName(), moduleID.get().version(), constructKind.get(),
                    symbol.get().getName().get());
            markupContent.setValue((content.isEmpty() ? "" : content + MarkupUtils.getHorizontalSeparator())
                    + "[View API Docs](" + url + ")");
            hoverObj.setContents(markupContent);
        }

        return hoverObj;
    }

Line commented on: if (symbol == null || symbol.isEmpty() || !symbolResolver.isSymbolReferable()) {

Revised code:
public static Hover getHover(HoverContext context) {
        Optional<Document> srcFile = context.currentDocument();
        Optional<SemanticModel> semanticModel = context.currentSemanticModel();
        if (semanticModel.isEmpty() || srcFile.isEmpty()) {
            return HoverUtil.getHoverObject("");
        }
        
        fillTokenInfoAtCursor(context);

        Position cursorPosition = context.getCursorPosition();
        LinePosition linePosition = LinePosition.from(cursorPosition.getLine(), cursorPosition.getCharacter());
        
        context.checkCancelled();
        Optional<? extends Symbol> symbolAtCursor = semanticModel.get().symbol(srcFile.get(), linePosition);
        
        context.checkCancelled();

        HoverObjectResolver provider = new HoverObjectResolver(context);
        Hover hoverObj = HoverUtil.getHoverObject("");

        
        if (symbolAtCursor.isEmpty()) {
            Range nodeRange = new Range(context.getCursorPosition(), context.getCursorPosition());
            NonTerminalNode nodeAtCursor = CommonUtil.findNode(nodeRange, srcFile.get().syntaxTree());
            if (nodeAtCursor != null) {
                MatchedExpressionNodeResolver expressionResolver = new MatchedExpressionNodeResolver(nodeAtCursor);
                Optional<ExpressionNode> expr = expressionResolver.findExpression(nodeAtCursor);
                if (expr.isPresent()) {
                    hoverObj = provider.getHoverObjectForExpression(expr.get());
                }
            }
        } else {
            hoverObj = provider.getHoverObjectForSymbol(symbolAtCursor.get());
        }
        
        if (hoverObj.getContents().isRight()) {
            MarkupContent markupContent = hoverObj.getContents().getRight();
            String content = markupContent.getValue();

            HoverSymbolResolver symbolResolver =
                    new HoverSymbolResolver(context, semanticModel.get());
            Optional<Symbol> symbol = context.getNodeAtCursor().apply(symbolResolver);
            if (symbol == null || symbol.isEmpty() || !symbolResolver.isSymbolReferable()) {
                return hoverObj;
            }

            Optional<ModuleID> moduleID = symbol.flatMap(Symbol::getModule).map(ModuleSymbol::id);
            Optional<HoverConstructKind> constructKind = symbolResolver.getConstructKind();
            if (moduleID.isEmpty() || symbol.get().getName().isEmpty() || constructKind.isEmpty()) {
                return hoverObj;
            }
            String url = APIDocReference.from(moduleID.get().orgName(),
                    moduleID.get().moduleName(), moduleID.get().version(), constructKind.get(),
                    symbol.get().getName().get());
            markupContent.setValue((content.isEmpty() ? "" : content + MarkupUtils.getHorizontalSeparator())
                    + "[View API Docs](" + url + ")");
            hoverObj.setContents(markupContent);
        }

        return hoverObj;
    }