You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2022/05/18 19:51:41 UTC

[royale-compiler] branch develop updated: formatter: null safety when formatting MXML

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new e9182dfd1 formatter: null safety when formatting MXML
e9182dfd1 is described below

commit e9182dfd13d7a90deebae3f0635c437fb2c7ad8f
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed May 18 12:51:30 2022 -0700

    formatter: null safety when formatting MXML
---
 formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java b/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java
index 75ba1ad9e..473ff7cb4 100644
--- a/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java
+++ b/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java
@@ -1764,6 +1764,10 @@ public class FORMATTER {
 	}
 
 	private String formatMXMLTextInternal(String filePath, String text, Collection<ICompilerProblem> problems) {
+		if (problems == null) {
+			problems = new ArrayList<ICompilerProblem>();
+		}
+
 		StringReader textReader = new StringReader(text);
 		MXMLTokenizer mxmlTokenizer = new MXMLTokenizer();
 		IMXMLToken[] originalTokens = null;