mayope / keycloakmigration

Manage your Keycloak configuration with code.
https://mayope.net
MIT License
108 stars 22 forks source link

NullPointerException when YAML file is not properly formatted #3

Closed Ingo-FP-Angel closed 5 years ago

Ingo-FP-Angel commented 5 years ago

I had an error in my YAML migration file (lines below "addUser" not properly indented):

- addUser:
  realm: example-realm
  name: jane@example.com
  enabled: true
  emailVerified: true

Expected behaviour: Running this migration should indicate that the file is not ok (ideally including the line number of the first error)

Actual behaviour: Running this migration gave a NullPointerException

Migration were unsuccessful see errors above!rations.DefaultBuildOperationExecutor] Build operation 'Resolve kotlin-stdlib.jar (org.jetbrains.kotlin:kotlin-stdlib:1.2.60)' cojava.lang.NullPointerException
        at de.klg71.keycloakmigration.changeControl.ChangeFileReader.changes$keycloakmigration(ChangeFileReader.kt:30)wnload-task.jar (de.undercouch:gradle-download-task:3.4.
        at de.klg71.keycloakmigration.changeControl.KeycloakMigration.execute$keycloakmigration(KeycloakMigration.kt:24)
        at de.klg71.keycloakmigration.MainKt$migrate$1$1.invoke(Main.kt:74)ve.CachingModuleComponentRepository] Found artifact 'gradle-download-task.jar (de.undercouch:gradle
        at de.klg71.keycloakmigration.MainKt$migrate$1$1.invoke(Main.kt)es\modules-2\files-2.1\de.undercouch\gradle-download-task\3.4.3\87aa1c57a1dd0da91488afe630058efb5d8068
        at org.koin.core.context.GlobalContextKt.startKoin(GlobalContext.kt:72)
        at de.klg71.keycloakmigration.MainKt.migrate(Main.kt:71)dOperationExecutor] Completing Build operation 'Resolve gradle-download-task.jar (de.undercouch:gradle-downloa
        at de.klg71.keycloakmigrationplugin.KeycloakMigrationTask.migrate(KeycloakMigrationPlugin.kt:50)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) operation 'Resolve gradle-download-task.jar (de.undercouch:gradle-download-task:3.4.
[...]
klg71 commented 5 years ago

Hello Ingo thank you for your bug report I will look into it 👍

klg71 commented 5 years ago

Should be fixed with 0.0.10 version right now