mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 22:29:13 +00:00
ChanViewer: Show "" instead of "undefined" for missing thread subjects
This broke due to a change in JsonValue API. JsonValue::to_string() now returns the value serialized to a string, which may become "undefined". You kinda want JsonValue::as_string(), but that is only callable when the JsonValue *is* a string. Thankfully there is now as_string_or(alt).
This commit is contained in:
@@ -126,9 +126,9 @@ GVariant ThreadCatalogModel::data(const GModelIndex& index, Role role) const
|
||||
case Column::ThreadNumber:
|
||||
return thread.get("no").to_u32();
|
||||
case Column::Subject:
|
||||
return thread.get("sub").to_string();
|
||||
return thread.get("sub").as_string_or({});
|
||||
case Column::Text:
|
||||
return thread.get("com").to_string();
|
||||
return thread.get("com").as_string_or({});
|
||||
case Column::ReplyCount:
|
||||
return thread.get("replies").to_u32();
|
||||
case Column::ImageCount:
|
||||
|
||||
Reference in New Issue
Block a user