TextView crashes app because textAttachmentDelegate? not set.
まだ誰も着手していません。
評価
調査の方向性
TextView の storage(_:placeholderFor:) の実装と、レポートで言及されている他の storage 関数を特定します。それらの fatalError の動作を textAttachmentDelegate のドキュメントと比較し、delegate なしで SwiftUI TextView をレンダリングしてもクラッシュせず、remote images が空のままになることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
TextView func storage(_ storage: TextStorage, placeholderFor attachment: NSTextAttachment) -> UIImage is crashing my app in production of the following guard statement contains a fatalError.
guard let textAttachmentDelegate = textAttachmentDelegate else {
fatalError("This class requires a text attachment delegate to be set.")
}
return textAttachmentDelegate.textView(self, placeholderFor: attachment)
The problem with this is that earlier in the file the following is explicitly stated for the textAttachmentDelegate optional.
/// The media delegate takes care of providing remote media when requested by the `TextView`.
/// If this is not set, all remove images will be left blank.
///
open weak var textAttachmentDelegate: TextViewAttachmentDelegate?
Which would imply that the TextView will continue to function, only without displaying images. Not fatalError crashing.
This seems to be the case with all of the storage functions.
To Reproduce
Steps to reproduce the behavior:
1.
Create an instance of the TextView without instantiating textAttachmentDelegate
- Render the Field in a SwiftUI view.
Expected behavior
A clear and concise description of what you expected to happen.
A TextView should continue to run rendering the HTML and images remain blank, WITHOUT crashing the app, as implied by the documentation. (Unless there is actually something called 'remove images'.)
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
- Device: iPhone 15 Pro
- OS: 17.5.1
Additional context
Add any other context about the problem here.
- 主要言語
- Swift
- スター
- 667
- フォーク
- 153
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wordpress-mobile/AztecEditor-iOS のほかの issue
-
Bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
wordpress-mobile/AztecEditor-iOS#1417 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
wordpress-mobile/AztecEditor-iOS#1411 ·
-
iOS 17 Crash - UIGraphicsBeginImageContext() failed to allocate CGBitampContext再び着手できるかも @jkmassel が 620 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
wordpress-mobile/AztecEditor-iOS#1401 · コメント 2 件 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
wordpress-mobile/AztecEditor-iOS#1399 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
wordpress-mobile/AztecEditor-iOS#1398 · コメント 1 件 · リアクション 1 件 ·
wordpress-mobile/AztecEditor-iOS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
schedule-review
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
daniezl/Hilltoppers#82 ·
メンテナーはふだん 1 日以内に返信
-
area/docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
CtcKeywordSpotter: input padding is not zeroed, so CTC log-probs are often independent of the audioオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
FluidInference/FluidAudio#991 ·
メンテナーはふだん 1 日以内に返信
-
agent-work needs-manual-intervention
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Provenance-Emu/Provenance#3726 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信