Skip to content

Commit 24c597d

Browse files
committed
Analysis: Mark theme demo rul as nullable where possible
1 parent 6ab1d0e commit 24c597d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

WordPress/src/main/java/org/wordpress/android/ui/themes/ThemeWebActivity.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ public static String getUrl(
128128
.format(THEME_URL_PREVIEW, UrlUtils.getHost(site.getUrl()), domain, theme.getThemeId());
129129
case DEMO:
130130
String url = theme.getDemoUrl();
131-
if (url.contains("?")) {
132-
return url + "&" + THEME_URL_DEMO_PARAMETER;
131+
if (url != null) {
132+
if (url.contains("?")) {
133+
return url + "&" + THEME_URL_DEMO_PARAMETER;
134+
} else {
135+
return url + "?" + THEME_URL_DEMO_PARAMETER;
136+
}
133137
} else {
134-
return url + "?" + THEME_URL_DEMO_PARAMETER;
138+
return null;
135139
}
136140
case DETAILS:
137141
return String.format(THEME_URL_DETAILS, theme.getThemeId());

0 commit comments

Comments
 (0)