Commit 87b7e8b0 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Merge branch 'fix-migration-npe' into 'master'

Fix NPE in migration of text content format

See merge request arsnova/arsnova-backend!175
parents 777a281f 6830cb78
......@@ -213,8 +213,10 @@ public class ToV2Migrator {
to.setQuestionType(V2_TYPE_FREETEXT);
break;
case TEXT:
final String legacyType = (String) from.getExtensions()
.getOrDefault("v2", Collections.emptyMap()).getOrDefault("format", "");
final String legacyType = from.getExtensions() != null
? (String) from.getExtensions()
.getOrDefault("v2", Collections.emptyMap()).getOrDefault("format", "")
: "";
switch (legacyType) {
case V2_TYPE_SLIDE:
to.setQuestionType(V2_TYPE_SLIDE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment