# Sieve of Eratosthenes Crash! NullPointerException

**URL:** https://discourse.processing.org/t/sieve-of-eratosthenes-crash-nullpointerexception/22450
**Category:** Coding Questions
**Tags:** homework
**Created:** [July 7, 2020, 2:04pm UTC](https://discourse.processing.org/t/sieve-of-eratosthenes-crash-nullpointerexception/22450 "2020-07-07T14:04:05Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [July 7, 2020, 8:49pm UTC](https://discourse.processing.org/t/sieve-of-eratosthenes-crash-nullpointerexception/22450/8 "2020-07-07T20:49:55Z")

</div>

Hello,

You need to initialize the array _before you use it_.

Review the setup() and consider the order of the code that you are executing from the top down.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/sieve-of-eratosthenes-crash-nullpointerexception/22450)._
