Added null-checking when adding projection ranges for code blocks.
Prevents the NullPointerException error in the editor from occurring.