mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:42:44 +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:
		
							parent
							
								
									9889d170b9
								
							
						
					
					
						commit
						351c354680
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -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: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling