This repository was archived by the owner on Feb 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed
fluxc/src/main/java/org/wordpress/android/fluxc/model Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -88,19 +88,18 @@ data class BlockEditorSettings(
8888 get() = features?.removeFontFamilies()
8989
9090 private fun JsonElement.removeFontFamilies (): JsonElement {
91- if (! isJsonObject) return this
92-
93- val featuresObject = asJsonObject
94- if (! featuresObject.has(" typography" )) return this
95-
96- val typography = featuresObject.get(" typography" )
97- if (! typography.isJsonObject) return this
98-
99- val typographyObject = typography.asJsonObject
100- if (! typographyObject.has(" fontFamilies" )) return this
101-
102- typographyObject.remove(" fontFamilies" )
103- return featuresObject
91+ if (isJsonObject && asJsonObject.has(" typography" )) {
92+ val featuresObject = asJsonObject
93+ val typography = featuresObject.get(" typography" )
94+ if (typography.isJsonObject) {
95+ val typographyObject = typography.asJsonObject
96+ if (typographyObject.has(" fontFamilies" )) {
97+ typographyObject.remove(" fontFamilies" )
98+ return featuresObject
99+ }
100+ }
101+ }
102+ return this
104103 }
105104}
106105
You can’t perform that action at this time.
0 commit comments