Idea plugin and multi-project setup

I’m trying to setup a multi-module gradle project with Idea support. It works until I’m adding project-wide to the mix. Here’s an example:

javaVersion = 1.8


include 'module_a'


allprojects {
  apply plugin: 'idea'
  idea {
    project {
      jdkName = javaVersion

module_a is an empty sub-folder.

gradle idea fails with this:

Build file 'project/build.gradle' line: 7

* What went wrong:
A problem occurred evaluating root project 'project'.
> Cannot set property 'jdkName' on null object

Looks like a bug to me, but I’m not sure. What could be the reason?
Gradle 2.12