From: Niki Roo Date: Mon, 27 Apr 2020 16:08:14 +0000 (+0200) Subject: potential crash on inforeader X-Git-Tag: fanfix-swing-1.0.0~12 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=1c77affeb27eeb6b2aacfc916ac834fe4a2ab1c3;p=fanfix-swing.git potential crash on inforeader --- diff --git a/src/be/nikiroo/fanfix/supported/InfoReader.java b/src/be/nikiroo/fanfix/supported/InfoReader.java index 1a00ef25..405b28fb 100644 --- a/src/be/nikiroo/fanfix/supported/InfoReader.java +++ b/src/be/nikiroo/fanfix/supported/InfoReader.java @@ -259,14 +259,17 @@ public class InfoReader { String value = getLine(in, key, 0); if (value != null && !value.isEmpty()) { value = value.trim().substring(key.length() - 1).trim(); - if (value.startsWith("'") && value.endsWith("'") - || value.startsWith("\"") && value.endsWith("\"")) { + if (value.length() > 1 && // + (value.startsWith("'") && value.endsWith("'") + || value.startsWith("\"") + && value.endsWith("\""))) { value = value.substring(1, value.length() - 1).trim(); } // Some old files ended up with TITLE="'xxxxx'" - if ("TITLE".equals(key)) { - if (value.startsWith("'") && value.endsWith("'")) { + if ("^TITLE=".equals(key)) { + if (value.startsWith("'") && value.endsWith("'") + && value.length() > 1) { value = value.substring(1, value.length() - 1).trim(); } }