解决天气类型无法获取导致的npe
This commit is contained in:
@@ -71,9 +71,12 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
|
||||
if ( weatherInfo == null ) {
|
||||
return;
|
||||
}
|
||||
String temp = getContext().getResources().getString( R.string.module_ext_str_weather_temp_format, weatherInfo.getTemperature() );
|
||||
Phenomena phenomena = Phenomena.getById( weatherInfo.getPhenomena() );
|
||||
String desc = phenomena == null ? "" : phenomena.nameCn;
|
||||
if ( phenomena == null ) {
|
||||
return;
|
||||
}
|
||||
String temp = getContext().getResources().getString( R.string.module_ext_str_weather_temp_format, weatherInfo.getTemperature() );
|
||||
String desc = phenomena.nameCn;
|
||||
int resId = phenomena.resId;
|
||||
mView.renderWeatherInfo( temp, desc, resId );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user