Berton's Workshop

A Record of Thought and Experience

Home Archives
2017-01-05

NullPointer Error in ArrayList When Iterating Through It by Foreach Function in Java

I found that even if an ArrayList is null, the List.isEmpty will still return a true value for unknown reason. In another word, use (blockodeList!=null && !blockodeList.isEmpty()) instead of just the second one to see if it is safe to operate the ArrayList.

Partager
  • Java
  • Solution
Récent
Ubuntu-Failure to download extra data files - ttf-mscorefonts-installer-Solution
Ancien
Allow scripts and other programs to boot with Linux

Mot-clés

  • Android
  • Bukkit
  • C
  • CPP
  • Comics
  • Compiler
  • Debug
  • FRC
  • File Recovery
  • Flash
  • GFW
  • Hack The Box
  • Java
  • Kindle
  • Linux
  • Machine Learning
  • Math
  • Network
  • Note
  • Outdated
  • Problem
  • Python
  • SSH
  • Security
  • Solution
  • Terminator
  • Thoughts
  • Vim
  • WinAPI
  • Xorg

Nuage de mot-clés

Android Bukkit C CPP Comics Compiler Debug FRC File Recovery Flash GFW Hack The Box Java Kindle Linux Machine Learning Math Network Note Outdated Problem Python SSH Security Solution Terminator Thoughts Vim WinAPI Xorg

Archives

  • October 2019
  • July 2019
  • January 2019
  • November 2018
  • October 2018
  • August 2018
  • July 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016

Articles récents

  • Hack The Box Write Up: Invitation Code
  • Comic: 7. Diamond And Lapis
  • Comic: 6. FRC Seasons in a Nutshell
  • Comic: 5. Acceptable Price Range of Pencils
  • Workaround for FRC ADXRS450 Gyro failure: Returning All Zeros
© 2019 D0048
Home Archives