Skip to content

Commit 240d6e7

Browse files
committed
Generate repository URL when is it missing
This will be the case when it is pulled from the local cache.
1 parent 7582b19 commit 240d6e7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/src/main/java/com/github/mobile/ui/repo/RepositoryViewActivity.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import static com.github.mobile.util.TypefaceUtils.ICON_NEWS;
2727
import android.content.Intent;
2828
import android.os.Bundle;
29+
import android.text.TextUtils;
2930
import android.widget.ProgressBar;
3031

3132
import com.actionbarsherlock.app.ActionBar;
@@ -174,7 +175,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
174175
starRepository();
175176
return true;
176177
case id.m_share:
177-
shareRepositoryURL();
178+
shareRepository();
178179
return true;
179180
case android.R.id.home:
180181
finish();
@@ -275,9 +276,12 @@ protected void onSuccess(Boolean watching) throws Exception {
275276
}.execute();
276277
}
277278

278-
private void shareRepositoryURL() {
279+
private void shareRepository() {
280+
String repoUrl = repository.getHtmlUrl();
281+
if (TextUtils.isEmpty(repoUrl))
282+
repoUrl = "https://github.com/" + repository.generateId();
279283
Intent sharingIntent = ShareUtils.create(repository.generateId(),
280-
repository.getHtmlUrl());
284+
repoUrl);
281285
startActivity(sharingIntent);
282286
}
283287
}

0 commit comments

Comments
 (0)