assert that data is not empty

This commit is contained in:
Vladimir Krivosheev
2017-05-26 19:59:00 +02:00
parent 6a9f70ad95
commit 2c4df1882d
2 changed files with 3 additions and 3 deletions
@@ -21,7 +21,7 @@ import com.intellij.openapi.util.JDOMUtil
import com.intellij.util.ReflectionUtil
import org.jdom.Element
private val LOG = Logger.getInstance("#com.intellij.openapi.components.impl.stores.DefaultStateSerializer")
internal val LOG = Logger.getInstance("#com.intellij.configurationStore")
fun <T> deserializeState(stateElement: Element?, stateClass: Class<T>, mergeInto: T?): T? {
@Suppress("DEPRECATION", "UNCHECKED_CAST")
@@ -53,8 +53,8 @@ class SchemeManagerIprProvider(private val subStateTagName: String) : StreamProv
}
override fun write(fileSpec: String, content: ByteArray, size: Int, roamingType: RoamingType) {
val name = PathUtilRt.getFileName(fileSpec)
nameToData.put(name, ArrayUtil.realloc(content, size))
LOG.assertTrue(content.isNotEmpty())
nameToData.put(PathUtilRt.getFileName(fileSpec), ArrayUtil.realloc(content, size))
}
fun load(state: Element?, nameGetter: ((Element) -> String)? = null) {