mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Improve error handling
This commit is contained in:
parent
e864dbbe18
commit
7432536495
@ -1355,6 +1355,16 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
var nsmgr = new XmlNamespaceManager(xml.NameTable);
|
var nsmgr = new XmlNamespaceManager(xml.NameTable);
|
||||||
nsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml");
|
nsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml");
|
||||||
XmlNode head = xml.DocumentElement.SelectSingleNode("ttml:head", nsmgr);
|
XmlNode head = xml.DocumentElement.SelectSingleNode("ttml:head", nsmgr);
|
||||||
|
if (head == null)
|
||||||
|
{
|
||||||
|
head = xml.DocumentElement.SelectSingleNode("head", nsmgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (head == null)
|
||||||
|
{
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (XmlNode node in head.SelectNodes("//ttml:style", nsmgr))
|
foreach (XmlNode node in head.SelectNodes("//ttml:style", nsmgr))
|
||||||
{
|
{
|
||||||
if (node.Attributes["xml:id"] != null)
|
if (node.Attributes["xml:id"] != null)
|
||||||
@ -1369,7 +1379,9 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
// Ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user