Skip to content

Commit

Permalink
Update error message for missing submission URL in Google Sheets uplo…
Browse files Browse the repository at this point in the history
…ader (getodk#2648)
  • Loading branch information
nshestiuk authored and grzesiek2010 committed Oct 23, 2018
1 parent f0a43be commit 91812dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ private UrlUtils() {
public static String getSpreadsheetID(String urlString) throws BadUrlException {
// now parse the url string if we have one
final String googleHeader = "docs.google.com/spreadsheets/d/";
if (urlString == null || urlString.length() < googleHeader.length()) {
if (urlString == null || urlString.isEmpty()) {
throw new BadUrlException(
Collect.getInstance().getString(R.string.missing_submission_url));
} else if (urlString.length() < googleHeader.length()) {
throw new BadUrlException(
Collect.getInstance().getString(R.string.invalid_sheet_id, urlString));
} else {
Expand Down
1 change: 1 addition & 0 deletions collect_app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
<string name="send_in_progress">Background send running, please try again shortly</string>
<string name="sheets_max_columns">Max number of columns is 255, your form has %s. Unable to upload to spreadsheet.</string>
<string name="invalid_sheet_id">invalid sheet id: %1$s</string>
<string name="missing_submission_url">Missing submission URL</string>
<string name="google_sheets_access_denied">Access denied. Please make sure the spreadsheet owner has granted you edit permission.</string>
<string name="google_sheets_missing_columns">Spreadsheet is missing the following columns: %1$s</string>
<string name="password_error_whitespace">Leading or trailing whitespace not allowed in passwords</string>
Expand Down

0 comments on commit 91812dc

Please sign in to comment.