| 104 | |
| 105 | template<typename T> |
| 106 | static std::optional<T> jniGetMapPropertyAndReturnValue( |
| 107 | JNIEnv* env, jlong ptr, jlong propPtr, jint index, bool optional) { |
| 108 | auto marshaller = unwrap(env, ptr); |
| 109 | if (marshaller == nullptr) { |
| 110 | return std::nullopt; |
| 111 | } |
| 112 | |
| 113 | if (!jniGetMapProperty(env, marshaller, propPtr, index, optional)) { |
| 114 | return std::nullopt; |
| 115 | } |
| 116 | |
| 117 | auto value = marshaller->getOrUndefined(-1).checkedTo<T>(marshaller->getExceptionTracker()); |
| 118 | marshaller->pop(); |
| 119 | if (!checkMarshaller(env, marshaller)) { |
| 120 | return std::nullopt; |
| 121 | } |
| 122 | |
| 123 | return {std::move(value)}; |
| 124 | } |
| 125 | |
| 126 | bool checkNotNull(JNIEnv* env, jobject object) { |
| 127 | if (object == nullptr) { |
nothing calls this directly
no test coverage detected