Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Fixed LiveLoggerActivity.runningActivity == null exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxieds committed Jun 29, 2019
1 parent b8cdeca commit fd168dd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,18 @@ public class LiveLoggerActivity extends AppCompatActivity {
* @see LogEntryMetadataRecord
*/
public static void appendNewLog(LogEntryBase logEntry) {
if(LiveLoggerActivity.selectedTab != TAB_LOG) {
if(LiveLoggerActivity.selectedTab != TAB_LOG && LiveLoggerActivity.runningActivity != null) {
if(logEntry instanceof LogEntryUI)
runningActivity.setStatusIcon(R.id.statusIconNewXFer, R.drawable.statusxfer16);
else
runningActivity.setStatusIcon(R.id.statusIconNewMsg, R.drawable.statusnewmsg16);
}
logDataFeed.addView(logEntry.getLayoutContainer());
logDataEntries.add(logEntry);
if(LiveLoggerActivity.runningActivity == null) {
return;
}
if(logEntry instanceof LogEntryMetadataRecord) { // switch to the log tab to display the results:
if(LiveLoggerActivity.runningActivity == null) {
return;
}
Log.i(TAG, String.format("LogEntryMetaData record height: %d", logEntry.getLayoutContainer().getHeight()));
TabLayout tabLayout = (TabLayout) LiveLoggerActivity.runningActivity.findViewById(R.id.tab_layout);
if(tabLayout != null) {
Expand Down

0 comments on commit fd168dd

Please sign in to comment.