Skip to content

Commit

Permalink
Fix assertions
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Internal][Fixed] - Fix non-null assertions

These assertions weren't asserting that these objects aren't null.

Reviewed By: mdvacca

Differential Revision: D21844260

fbshipit-source-id: 6102fb304ddb6db61411e15c32355e4c3d3effca
  • Loading branch information
Luna Wei authored and facebook-github-bot committed Jun 2, 2020
1 parent 29f0ced commit ceb6c3d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public static DisplayMetrics getScreenDisplayMetrics() {
}

public static Map<String, Map<String, Object>> getDisplayMetricsMap(double fontScale) {
Assertions.assertNotNull(
sWindowDisplayMetrics != null || sScreenDisplayMetrics != null,
Assertions.assertCondition(
sWindowDisplayMetrics != null && sScreenDisplayMetrics != null,
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics");
final Map<String, Map<String, Object>> result = new HashMap<>();
result.put("windowPhysicalPixels", getPhysicalPixelsMap(sWindowDisplayMetrics, fontScale));
Expand All @@ -114,8 +114,8 @@ public static Map<String, Map<String, Object>> getDisplayMetricsMap(double fontS
}

public static WritableNativeMap getDisplayMetricsNativeMap(double fontScale) {
Assertions.assertNotNull(
sWindowDisplayMetrics != null || sScreenDisplayMetrics != null,
Assertions.assertCondition(
sWindowDisplayMetrics != null && sScreenDisplayMetrics != null,
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics");
final WritableNativeMap result = new WritableNativeMap();
result.putMap(
Expand Down

0 comments on commit ceb6c3d

Please sign in to comment.