changeset 10669:c33a9143717d

8189641: [Accessibility, windows] NPE when navigating to ComboBox with empty string Reviewed-by: kcr
author pkbalakr
date Thu, 19 Oct 2017 08:33:23 -0700
parents 8c150dbef9c5
children 81836ae88add
files modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Wed Oct 18 19:18:44 2017 +0530
+++ b/modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Thu Oct 19 08:33:23 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -490,6 +490,7 @@
 
         @SuppressWarnings("unchecked")
         ObservableList<Node> children = (ObservableList<Node>)acc.getAttribute(CHILDREN);
+        if (children == null) return FXCollections.emptyObservableList();
         return children.stream()
                 .filter(Node::isVisible)
                 .collect(Collectors.toList());
@@ -1364,6 +1365,7 @@
             documentRange = new WinTextRangeProvider(this);
         }
         String text = (String)getAttribute(TEXT);
+        if (text == null) return 0;
         documentRange.setRange(0, text.length());
         return documentRange.getNativeProvider();
     }