Skip to content

Commit

Permalink
修复了一些可能导致崩溃的问题
Browse files Browse the repository at this point in the history
修复红米澎湃os里站出现空指针报错的问题
  • Loading branch information
xiaojieonly committed Oct 2, 2024
1 parent 50feda5 commit 6cf29f0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/hippo/ehviewer/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,9 @@ public static String getImageResolution() {
}

public static void putImageResolution(String value) {
if(null==value){
return;
}
sEhConfig.imageSize = value;
sEhConfig.setDirty();
putString(KEY_IMAGE_RESOLUTION, value);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/hippo/ehviewer/client/EhClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.content.Context;
import android.os.AsyncTask;

import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.client.data.userTag.TagPushParam;
import com.hippo.ehviewer.client.data.userTag.UserTag;
Expand Down Expand Up @@ -218,6 +219,7 @@ protected void onPostExecute(Object result) {
if (!(result instanceof CancelledException)) {
if (result instanceof Exception) {
mCallback.onFailure((Exception) result);
FirebaseCrashlytics.getInstance().recordException((Throwable) result);
} else {
mCallback.onSuccess(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static class Result {
public String nextHref;
public String lastHref;
public boolean noWatchedTags;
public List<GalleryInfo> galleryInfoList;
public List<GalleryInfo> galleryInfoList = new ArrayList<>();
}

private static int parsePages(Document d, String body) throws ParseException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public FavoriteListSortDialog(FavoritesScene scene) {

public void showCloudSort(FavoritesParser.Result mResult) {
int checked;
if (null == mResult.favOrder) {
if (null == mResult || null == mResult.favOrder) {
return;
}
if (mResult.favOrder.equals(ORDER_BY_FAV_TIME)) {
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/hippo/widget/ContentLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ public ContentLayout(Context context, AttributeSet attrs, int defStyleAttr) {
private void init(Context context) {
LayoutInflater.from(context).inflate(R.layout.widget_content_layout, this);

mProgressView = (ProgressView) findViewById(R.id.progress);
mTipView = (TextView) findViewById(R.id.tip);
mContentView = (ViewGroup) findViewById(R.id.content_view);
mProgressView = findViewById(R.id.progress);
mTipView = findViewById(R.id.tip);
mContentView = findViewById(R.id.content_view);

mRefreshLayout = (RefreshLayout) mContentView.findViewById(R.id.refresh_layout);
mFastScroller = (FastScroller) mContentView.findViewById(R.id.fast_scroller);
mRecyclerView = (EasyRecyclerView) mRefreshLayout.findViewById(R.id.recycler_view);
mRefreshLayout = mContentView.findViewById(R.id.refresh_layout);
mFastScroller = mContentView.findViewById(R.id.fast_scroller);
mRecyclerView = mRefreshLayout.findViewById(R.id.recycler_view);

mFastScroller.attachToRecyclerView(mRecyclerView);
HandlerDrawable drawable = new HandlerDrawable();
Expand Down

0 comments on commit 6cf29f0

Please sign in to comment.