bugfix : npe
This commit is contained in:
@@ -87,7 +87,7 @@ public class AppsModel {
|
||||
continue;
|
||||
}
|
||||
int page = counter++ / AppsConst.TOTAL_SIZE_EACH_PAGE;
|
||||
if ( !mPagedApps.containsKey( page ) ) {
|
||||
if ( mPagedApps.get( page ) == null ) {
|
||||
mPagedApps.put( page, new ArrayList<>() );
|
||||
}
|
||||
String appName = getApplicationName( packageManager, packageInfo );
|
||||
@@ -131,7 +131,7 @@ public class AppsModel {
|
||||
Drawable appIcon = packageInfo.applicationInfo.loadIcon( packageManager );
|
||||
AppInfo appInfo = new AppInfo( appName, packageName, versionName, versionCode, appIcon, AppEnumHelper.getCustomizedAppIconResId( packageName ) );
|
||||
int pageIndex = getPageIndex( packageName, true );
|
||||
if ( !mPagedApps.containsKey( pageIndex ) ) {
|
||||
if ( mPagedApps.get( pageIndex ) == null ) {
|
||||
mPagedApps.put( pageIndex, new ArrayList<>() );
|
||||
}
|
||||
mPagedApps.get( pageIndex ).add( appInfo );
|
||||
@@ -205,7 +205,7 @@ public class AppsModel {
|
||||
continue;
|
||||
}
|
||||
int page = counter++ / AppsConst.TOTAL_SIZE_EACH_PAGE + pageIndex;
|
||||
if ( !mPagedApps.containsKey( page ) ) {
|
||||
if ( mPagedApps.get( page ) == null ) {
|
||||
mPagedApps.put( page, new ArrayList<>() );
|
||||
}
|
||||
mPagedApps.get( page ).add( appInfo );
|
||||
|
||||
Reference in New Issue
Block a user