File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
java/fr/free/nrw/commons/media Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1414import android .widget .LinearLayout ;
1515import android .widget .ScrollView ;
1616import android .widget .TextView ;
17+ import android .widget .Toast ;
1718
1819import java .io .IOException ;
1920import java .text .SimpleDateFormat ;
@@ -273,7 +274,12 @@ private void setTextFields(Media media) {
273274 }
274275
275276 private void setOnClickListeners (final Media media ) {
276- license .setOnClickListener (v -> openWebBrowser (licenseLink (media )));
277+ if (licenseLink (media ) != null ) {
278+ license .setOnClickListener (v -> openWebBrowser (licenseLink (media )));
279+ } else {
280+ Toast toast = Toast .makeText (getContext (), getString (R .string .null_url ), Toast .LENGTH_SHORT );
281+ toast .show ();
282+ }
277283 if (media .getCoordinates () != null ) {
278284 coordinates .setOnClickListener (v -> openMap (media .getCoordinates ()));
279285 }
Original file line number Diff line number Diff line change 224224 <string name =" login_to_your_account" >Login to your account</string >
225225 <string name =" send_log_file" >Send log file</string >
226226 <string name =" send_log_file_description" >Send log file to developers via email</string >
227+ <string name =" null_url" >Error! URL not found</string >
227228
228229 <string name =" nearby_location_has_not_changed" >Location has not changed.</string >
229230 <string name =" nearby_location_not_available" >Location not available.</string >
You can’t perform that action at this time.
0 commit comments